Add cbase mutator

This commit is contained in:
Dan Kubb 2013-07-23 21:58:10 -07:00
parent 345b67144a
commit 14133fe199
4 changed files with 44 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/cbase'
require 'mutant/mutator/node/const'
require 'mutant/mutator/node/named_value/access'
require 'mutant/mutator/node/named_value/constant_assignment'

View file

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

View file

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

View file

@ -0,0 +1,17 @@
require 'spec_helper'
describe Mutant::Mutator::Node::NamedValue::Access, 'cbase' do
before do
Mutant::Random.stub(:hex_string => :random)
end
let(:source) { '::A' }
let(:mutations) do
mutants = []
mutants << 'nil'
end
it_should_behave_like 'a mutator'
end