Fix begin mutator to visit children

This commit is contained in:
Markus Schirp 2013-07-25 20:23:30 +02:00
parent b88d3ccc87
commit 811b4737da
2 changed files with 4 additions and 1 deletions

View file

@ -21,7 +21,8 @@ module Mutant
emit_self(*children) emit_self(*children)
end end
end end
children.each do |child| children.each_with_index do |child, index|
mutate_child(index)
emit(child) emit(child)
end end
end end

View file

@ -191,6 +191,8 @@ describe Mutant::Mutator, 'send' do
mutations = [] mutations = []
mutations << 'foo' mutations << 'foo'
mutations << 'left - right' mutations << 'left - right'
mutations << 'left / foo'
mutations << 'right / foo'
end end
it_should_behave_like 'a mutator' it_should_behave_like 'a mutator'