From 811b4737da7636761b431e71f0f7f8f28ef6886b Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Thu, 25 Jul 2013 20:23:30 +0200 Subject: [PATCH] Fix begin mutator to visit children --- lib/mutant/mutator/node/begin.rb | 3 ++- spec/unit/mutant/mutator/node/send/mutation_spec.rb | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/mutant/mutator/node/begin.rb b/lib/mutant/mutator/node/begin.rb index cda4cefc..23bf4e5e 100644 --- a/lib/mutant/mutator/node/begin.rb +++ b/lib/mutant/mutator/node/begin.rb @@ -21,7 +21,8 @@ module Mutant emit_self(*children) end end - children.each do |child| + children.each_with_index do |child, index| + mutate_child(index) emit(child) end end diff --git a/spec/unit/mutant/mutator/node/send/mutation_spec.rb b/spec/unit/mutant/mutator/node/send/mutation_spec.rb index 3742a4f0..9d40939d 100644 --- a/spec/unit/mutant/mutator/node/send/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/send/mutation_spec.rb @@ -191,6 +191,8 @@ describe Mutant::Mutator, 'send' do mutations = [] mutations << 'foo' mutations << 'left - right' + mutations << 'left / foo' + mutations << 'right / foo' end it_should_behave_like 'a mutator'