
* I dislike the global infection RSpec does. This commit is a first step to get a rid of it. * Also remove the need for `require 'spec_helper` in each spec file with adjusting `.rspec`.
21 lines
605 B
Ruby
21 lines
605 B
Ruby
RSpec.describe Mutant::Matcher::Compiler::SubjectPrefix do
|
|
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
|