Add specs for mutation filter
This commit is contained in:
parent
8ffffa0580
commit
251fe68175
2 changed files with 18 additions and 0 deletions
|
@ -103,6 +103,7 @@ require 'mutant/matcher/method/instance'
|
||||||
require 'mutant/matcher/methods'
|
require 'mutant/matcher/methods'
|
||||||
require 'mutant/matcher/namespace'
|
require 'mutant/matcher/namespace'
|
||||||
require 'mutant/matcher/scope'
|
require 'mutant/matcher/scope'
|
||||||
|
require 'mutant/matcher/filter'
|
||||||
require 'mutant/killer'
|
require 'mutant/killer'
|
||||||
require 'mutant/killer/static'
|
require 'mutant/killer/static'
|
||||||
require 'mutant/killer/rspec'
|
require 'mutant/killer/rspec'
|
||||||
|
|
17
spec/unit/mutant/matcher/filter_spec.rb
Normal file
17
spec/unit/mutant/matcher/filter_spec.rb
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Mutant::Matcher::Filter do
|
||||||
|
let(:object) { described_class.new(matcher, predicate) }
|
||||||
|
let(:matcher) { [:foo, :bar] }
|
||||||
|
|
||||||
|
let(:predicate) { Mutant::Predicate::Attribute::Equality.new(:to_s, 'foo') }
|
||||||
|
|
||||||
|
describe '#each' do
|
||||||
|
subject { object.each { |item| yields << item } }
|
||||||
|
|
||||||
|
let(:yields) { [] }
|
||||||
|
its(:to_a) { should eql([:bar]) }
|
||||||
|
|
||||||
|
it_should_behave_like 'an #each method'
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue