Add explicit mutator for restarg

This commit is contained in:
Dan Kubb 2013-09-07 19:49:55 -07:00
parent d7013cd558
commit e77ff73be2
4 changed files with 18 additions and 2 deletions

View file

@ -71,6 +71,7 @@ require 'mutant/mutator/node/noop'
require 'mutant/mutator/node/while'
require 'mutant/mutator/node/super'
require 'mutant/mutator/node/zsuper'
require 'mutant/mutator/node/restarg'
require 'mutant/mutator/node/send'
require 'mutant/mutator/node/send/binary'
require 'mutant/mutator/node/when'

View file

@ -13,7 +13,7 @@ module Mutant
:next, :break, :ensure,
:dstr, :dsym, :yield, :rescue, :redo, :defined?,
:blockarg, :op_asgn, :and_asgn,
:regopt, :restarg, :resbody, :retry, :arg_expr,
:regopt, :resbody, :retry, :arg_expr,
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty,
:alias, :for, :xstr, :back_ref, :class,
:sclass, :match_with_lvasgn, :match_current_line, :or_asgn, :kwbegin

View file

@ -0,0 +1,15 @@
# encoding: utf-8
module Mutant
class Mutator
class Node
# Restarg mutator
class Restarg < Generic
handle(:restarg)
end # Restarg
end # Node
end # Mutator
end # Mutant

View file

@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutant::Mutator::Node::Generic, 'restarg' do
describe Mutant::Mutator::Node::Restarg, 'restarg' do
let(:source) { 'foo(*bar)' }
let(:mutations) do