Add kwarg mutations

This commit is contained in:
John Backus 2016-04-05 01:17:00 -07:00
parent 609ef40aa6
commit 2bcbfde35a
3 changed files with 3 additions and 2 deletions

View file

@ -4,7 +4,7 @@ module Mutant
# Mutator for required arguments
class Argument < self
handle(:arg)
handle(:arg, :kwarg)
UNDERSCORE = '_'.freeze

View file

@ -9,7 +9,7 @@ module Mutant
# your contribution is that close!
handle(
:ensure, :redo, :regopt, :retry, :arg_expr, :blockarg,
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty,
:kwrestarg, :kwoptarg, :undef, :module, :empty,
:alias, :for, :xstr, :back_ref, :class, :restarg,
:sclass, :match_with_lvasgn, :while_post,
:until_post, :preexe, :postexe, :iflipflop, :eflipflop, :kwsplat,

View file

@ -4,4 +4,5 @@ Mutant::Meta::Example.add :kwarg do
mutation 'def foo; end'
mutation 'def foo(bar:); raise; end'
mutation 'remove_method(:foo)'
mutation 'def foo(_bar:); end'
end