2014-08-10 21:04:05 +00:00
|
|
|
RSpec.describe Mutant::Matcher::Compiler::SubjectPrefix do
|
2014-07-13 21:04:23 +00:00
|
|
|
let(:object) { described_class.new(Mutant::Expression.parse('Foo*')) }
|
|
|
|
|
|
|
|
let(:_subject) { double('Subject', expression: Mutant::Expression.parse(subject_expression)) }
|
|
|
|
|
|
|
|
describe '#call' do
|
|
|
|
subject { object.call(_subject) }
|
|
|
|
|
|
|
|
context 'when subject expression is prefixed by expression' do
|
|
|
|
let(:subject_expression) { 'Foo::Bar' }
|
|
|
|
|
|
|
|
it { should be(true) }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when subject expression is NOT prefixed by expression' do
|
|
|
|
let(:subject_expression) { 'Bar' }
|
|
|
|
|
|
|
|
it { should be(false) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|