Add block_pass mutator

This commit is contained in:
Dan Kubb 2013-07-28 13:20:09 -07:00
parent bec85b6431
commit 25bc3b9bc0
4 changed files with 39 additions and 1 deletions

View file

@ -57,6 +57,7 @@ require 'mutant/mutator/node/literal/nil'
require 'mutant/mutator/node/argument'
require 'mutant/mutator/node/arguments'
require 'mutant/mutator/node/begin'
require 'mutant/mutator/node/block_pass'
require 'mutant/mutator/node/cbase'
require 'mutant/mutator/node/connective/binary'
require 'mutant/mutator/node/const'

View file

@ -0,0 +1,25 @@
module Mutant
class Mutator
class Node
# Mutation emitter to handle block_pass nodes
class BlockPass < self
handle(:block_pass)
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
# noop, for now
end
end # BlockPass
end # Node
end # Mutator
end # Mutant

View file

@ -11,7 +11,7 @@ module Mutant
:defined,
:next, :break, :match, :ensure,
:dstr, :dsym, :yield, :rescue, :redo, :defined?,
:blockarg, :block_pass, :op_asgn, :and_asgn,
:blockarg, :op_asgn, :and_asgn,
:regopt, :restarg, :resbody, :retry, :arg_expr,
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty,
:alias, :for, :xstr, :back_ref, :nth_ref, :class,

View file

@ -0,0 +1,12 @@
require 'spec_helper'
describe Mutant::Mutator::Node::NamedValue::Access, 'block_pass' do
let(:source) { 'foo(&bar)' }
let(:mutations) do
mutants = []
mutants << 'foo'
end
it_should_behave_like 'a mutator'
end