Restore Mutatee#each spec

This commit is contained in:
Markus Schirp 2012-08-01 18:19:12 +02:00
parent 04e4f454ec
commit 6d7438f144
2 changed files with 11 additions and 3 deletions

View file

@ -29,9 +29,17 @@ module Mutant
#
# @api private
#
def each(&block)
def each
return to_enum unless block_given?
Mutator.each(node, &block)
# FIXME:
# Rubinus <=> Rspec bug
#
# Mutator.each(node,&block)
#
# results in rspec expectation mismatch
Mutator.each(node) do |mutant|
yield mutant
end
self
end

View file

@ -14,7 +14,7 @@ describe Mutant::Mutatee, '#each' do
Mutant::Mutator.stub(:each).with(ast).and_yield(mutation).and_return(Mutant::Mutator)
end
#it_should_behave_like 'an #each method'
it_should_behave_like 'an #each method'
it 'should initialize mutator with ast' do
Mutant::Mutator.should_receive(:each).with(ast).and_yield(mutation).and_return(Mutant::Mutator)