free_mutant/spec/unit/mutant/cache_spec.rb
2015-05-31 22:06:59 +00:00

22 lines
477 B
Ruby

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