Fix propagation of splat args

Closes #39
This commit is contained in:
Markus Schirp 2013-06-21 16:18:11 +02:00
parent ee6b8ddb71
commit 8b7be8a565
3 changed files with 14 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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' }