Merge pull request #112 from mbj/blockarg-mutator

Add explicit mutator for blockarg
This commit is contained in:
Markus Schirp 2013-09-08 23:34:41 -07:00
commit 8988cfabcd
4 changed files with 33 additions and 1 deletions

View file

@ -61,6 +61,7 @@ require 'mutant/mutator/node/literal/regex'
require 'mutant/mutator/node/literal/nil'
require 'mutant/mutator/node/argument'
require 'mutant/mutator/node/arguments'
require 'mutant/mutator/node/blockarg'
require 'mutant/mutator/node/begin'
require 'mutant/mutator/node/connective/binary'
require 'mutant/mutator/node/const'

View file

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

View file

@ -12,7 +12,6 @@ module Mutant
handle(
:next, :break, :ensure,
:yield, :rescue, :redo, :defined?,
:blockarg,
:regopt, :resbody, :retry, :arg_expr,
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty,
:alias, :for, :xstr, :back_ref, :class,

View file

@ -0,0 +1,17 @@
# encoding: utf-8
require 'spec_helper'
describe Mutant::Mutator::Node::Blockarg, 'blockarg' do
let(:source) { 'foo { |&bar| }' }
let(:mutations) do
mutations = []
mutations << 'foo { |&bar| raise }'
mutations << 'foo {}'
mutations << 'foo'
mutations << 'nil'
end
it_should_behave_like 'a mutator'
end