free_mutant/spec/unit/mutant/expression/namespace/flat_spec.rb
Markus Schirp 8233c5871f Reduce matcher interface
* New primary interface #call makes specs and implementations much
  easier
* We had #each mostly for historical reasons that are not relevant
  anymore
* Mutation covers the Mutant::Matcher namespace
2015-10-28 20:13:00 +00:00

26 lines
663 B
Ruby

RSpec.describe Mutant::Expression::Namespace::Exact do
let(:object) { parse_expression(input) }
let(:input) { 'TestApp::Literal' }
describe '#matcher' do
subject { object.matcher }
it { should eql(Mutant::Matcher::Scope.new(TestApp::Literal)) }
end
describe '#match_length' do
subject { object.match_length(other) }
context 'when other is an equivalent expression' do
let(:other) { parse_expression(object.syntax) }
it { should be(object.syntax.length) }
end
context 'when other is an unequivalent expression' do
let(:other) { parse_expression('Foo*') }
it { should be(0) }
end
end
end