Add specification for Mutant::Expression#prefix?
This commit is contained in:
parent
1989b76991
commit
c7113f7e82
1 changed files with 19 additions and 0 deletions
|
@ -36,8 +36,27 @@ RSpec.describe Mutant::Expression do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#prefix?' do
|
||||
let(:object) { described_class.parse('Foo*') }
|
||||
|
||||
subject { object.prefix?(other) }
|
||||
|
||||
context 'when object is a prefix of other' do
|
||||
let(:other) { described_class.parse('Foo::Bar') }
|
||||
|
||||
it { should be(true) }
|
||||
end
|
||||
|
||||
context 'when other is not a prefix of other' do
|
||||
let(:other) { described_class.parse('Bar') }
|
||||
|
||||
it { should be(false) }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#inspect' do
|
||||
let(:object) { described_class.parse('Foo') }
|
||||
|
||||
subject { object.inspect }
|
||||
|
||||
it { should eql('<Mutant::Expression: Foo>') }
|
||||
|
|
Loading…
Reference in a new issue