From 251fe6817567a54728e52d55e02ef6059912953c Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Sun, 8 Sep 2013 21:58:39 +0200 Subject: [PATCH] Add specs for mutation filter --- lib/mutant.rb | 1 + spec/unit/mutant/matcher/filter_spec.rb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 spec/unit/mutant/matcher/filter_spec.rb diff --git a/lib/mutant.rb b/lib/mutant.rb index c946b2ca..7ec2b29c 100644 --- a/lib/mutant.rb +++ b/lib/mutant.rb @@ -103,6 +103,7 @@ require 'mutant/matcher/method/instance' require 'mutant/matcher/methods' require 'mutant/matcher/namespace' require 'mutant/matcher/scope' +require 'mutant/matcher/filter' require 'mutant/killer' require 'mutant/killer/static' require 'mutant/killer/rspec' diff --git a/spec/unit/mutant/matcher/filter_spec.rb b/spec/unit/mutant/matcher/filter_spec.rb new file mode 100644 index 00000000..fe66a053 --- /dev/null +++ b/spec/unit/mutant/matcher/filter_spec.rb @@ -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