diff --git a/lib/mutant.rb b/lib/mutant.rb index c946b2ca..db9be60e 100644 --- a/lib/mutant.rb +++ b/lib/mutant.rb @@ -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' diff --git a/lib/mutant/mutator/node/dsym.rb b/lib/mutant/mutator/node/dsym.rb new file mode 100644 index 00000000..cee1bb3c --- /dev/null +++ b/lib/mutant/mutator/node/dsym.rb @@ -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 diff --git a/lib/mutant/mutator/node/generic.rb b/lib/mutant/mutator/node/generic.rb index 5b6721a2..9bb30923 100644 --- a/lib/mutant/mutator/node/generic.rb +++ b/lib/mutant/mutator/node/generic.rb @@ -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, diff --git a/spec/unit/mutant/mutator/node/dsym/mutation_spec.rb b/spec/unit/mutant/mutator/node/dsym/mutation_spec.rb index 1fe8f35a..e9d9e75c 100644 --- a/spec/unit/mutant/mutator/node/dsym/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/dsym/mutation_spec.rb @@ -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'