diff --git a/lib/mutant/mutator/node/noop.rb b/lib/mutant/mutator/node/noop.rb index 873a1697..b35bb095 100644 --- a/lib/mutant/mutator/node/noop.rb +++ b/lib/mutant/mutator/node/noop.rb @@ -9,12 +9,8 @@ module Mutant :self, :zsuper, :not, :or, :and, :defined, :next, :break, :match, :gvar, :cvar, :ensure, :rescue, :dstr, :dsym, :yield, :begin, :rescue, :gvasgn, - :lvar, - :const, - :blockarg, - :block_pass, - :ivar, - :restarg + :lvar, :splat, :const, :blockarg, :block_pass, + :ivar, :restarg ) private diff --git a/lib/mutant/mutator/node/send/binary.rb b/lib/mutant/mutator/node/send/binary.rb index 2632a066..2d8e14d0 100644 --- a/lib/mutant/mutator/node/send/binary.rb +++ b/lib/mutant/mutator/node/send/binary.rb @@ -19,7 +19,7 @@ module Mutant def dispatch emit(left) emit_left_mutations - emit(right) + emit(right) unless right.type == :splat emit_right_mutations end diff --git a/spec/unit/mutant/mutator/node/send/mutation_spec.rb b/spec/unit/mutant/mutator/node/send/mutation_spec.rb index bb06fc6c..11f88010 100644 --- a/spec/unit/mutant/mutator/node/send/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/send/mutation_spec.rb @@ -12,6 +12,17 @@ describe Mutant::Mutator, 'send' do end end + context 'single splat arg splat' do + let(:source) { 'foo[*bar]' } + + let(:mutations) do + mutations = [] + mutations << 'foo' + end + + it_should_behave_like 'a mutator' + end + context 'with self as' do context 'implicit' do let(:source) { 'foo' }