Add block_pass mutator
This commit is contained in:
parent
bec85b6431
commit
25bc3b9bc0
4 changed files with 39 additions and 1 deletions
|
@ -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'
|
||||
|
|
25
lib/mutant/mutator/node/block_pass.rb
Normal file
25
lib/mutant/mutator/node/block_pass.rb
Normal 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
|
|
@ -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,
|
||||
|
|
12
spec/unit/mutant/mutator/node/block_pass/mutation_spec.rb
Normal file
12
spec/unit/mutant/mutator/node/block_pass/mutation_spec.rb
Normal 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
|
Loading…
Add table
Reference in a new issue