Fix specification holes in Module::Cache

This commit is contained in:
Markus Schirp 2015-05-31 22:06:59 +00:00
parent 27ef116c38
commit 09a759f93f

View 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