Fix specification holes in Module::Cache
This commit is contained in:
parent
27ef116c38
commit
09a759f93f
1 changed files with 22 additions and 0 deletions
22
spec/unit/mutant/cache_spec.rb
Normal file
22
spec/unit/mutant/cache_spec.rb
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
RSpec.describe Mutant::Cache do
|
||||||
|
let(:object) { described_class.new }
|
||||||
|
|
||||||
|
describe '#parse' do
|
||||||
|
let(:path) { double('Path') }
|
||||||
|
|
||||||
|
subject { object.parse(path) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
allow(File).to receive(:read).with(path).and_return(':source')
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'returns parsed source' do
|
||||||
|
expect(subject).to eql(s(:sym, :source))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'returns cached parsed source' do
|
||||||
|
source = object.parse(path)
|
||||||
|
expect(subject).to be(source)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue