Add explicit mutator for dsym

This commit is contained in:
Dan Kubb 2013-09-08 08:17:47 -07:00
parent 8ffffa0580
commit 104d2b7b05
4 changed files with 32 additions and 2 deletions

View file

@ -65,6 +65,7 @@ require 'mutant/mutator/node/begin'
require 'mutant/mutator/node/connective/binary'
require 'mutant/mutator/node/const'
require 'mutant/mutator/node/dstr'
require 'mutant/mutator/node/dsym'
require 'mutant/mutator/node/named_value/access'
require 'mutant/mutator/node/named_value/constant_assignment'
require 'mutant/mutator/node/named_value/variable_assignment'

View file

@ -0,0 +1,28 @@
# encoding: utf-8
module Mutant
class Mutator
class Node
# Dsym mutator
class Dsym < Generic
handle(:dsym)
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
super
emit_nil
end
end # Dsym
end # Node
end # Mutator
end # Mutant

View file

@ -11,7 +11,7 @@ module Mutant
# your contribution is that close!
handle(
:next, :break, :ensure,
:dsym, :yield, :rescue, :redo, :defined?,
:yield, :rescue, :redo, :defined?,
:blockarg,
:regopt, :resbody, :retry, :arg_expr,
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty,

View file

@ -2,7 +2,7 @@
require 'spec_helper'
describe Mutant::Mutator::Node::Generic, 'dsum' do
describe Mutant::Mutator::Node::Dsym, 'dsym' do
before do
Mutant::Random.stub(:hex_string => 'random')
end
@ -16,6 +16,7 @@ describe Mutant::Mutator::Node::Generic, 'dsum' do
mutations << ':"foo#{bar}random"'
mutations << ':"foo#{bar}#{nil}"'
mutations << ':"foo#{nil}baz"'
mutations << 'nil'
end
it_should_behave_like 'a mutator'