spec/unit/mutant/expression_spec.rb in mutant-0.8.24 vs spec/unit/mutant/expression_spec.rb in mutant-0.9.0
- old
+ new
@@ -1,23 +1,21 @@
# frozen_string_literal: true
RSpec.describe Mutant::Expression do
- let(:parser) { Mutant::Config::DEFAULT.expression_parser }
-
describe '#prefix?' do
- let(:object) { parser.call('Foo*') }
+ let(:object) { parse_expression('Foo*') }
subject { object.prefix?(other) }
context 'when object is a prefix of other' do
- let(:other) { parser.call('Foo::Bar') }
+ let(:other) { parse_expression('Foo::Bar') }
it { should be(true) }
end
context 'when other is not a prefix of other' do
- let(:other) { parser.call('Bar') }
+ let(:other) { parse_expression('Bar') }
it { should be(false) }
end
end
@@ -30,16 +28,16 @@
end
end
subject { object.try_parse(input) }
- context 'on successful parse' do
+ context 'good input' do
let(:input) { 'foo' }
it { should eql(object.new(foo: 'foo')) }
end
- context 'on unsuccessful parse' do
+ context 'bad input' do
let(:input) { 'bar' }
it { should be(nil) }
end
end