From 1d567f65f14bbcc1c823770edc08c6f8239761cc Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sat, 7 Sep 2013 21:28:37 -0700 Subject: [PATCH] Add explicit mutator for dstr --- lib/mutant.rb | 1 + lib/mutant/mutator/node/dstr.rb | 15 +++++++++++++++ lib/mutant/mutator/node/generic.rb | 2 +- .../mutant/mutator/node/dstr/mutation_spec.rb | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 lib/mutant/mutator/node/dstr.rb diff --git a/lib/mutant.rb b/lib/mutant.rb index 8c082180..f08496e3 100644 --- a/lib/mutant.rb +++ b/lib/mutant.rb @@ -64,6 +64,7 @@ require 'mutant/mutator/node/arguments' 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/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/dstr.rb b/lib/mutant/mutator/node/dstr.rb new file mode 100644 index 00000000..33ba45b4 --- /dev/null +++ b/lib/mutant/mutator/node/dstr.rb @@ -0,0 +1,15 @@ +# encoding: utf-8 + +module Mutant + class Mutator + class Node + + # Dstr mutator + class Dstr < Generic + + handle(:dstr) + + end # Dstr + end # Node + end # Mutator +end # Mutant diff --git a/lib/mutant/mutator/node/generic.rb b/lib/mutant/mutator/node/generic.rb index 4898fcf8..b2b55ce7 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, - :dstr, :dsym, :yield, :rescue, :redo, :defined?, + :dsym, :yield, :rescue, :redo, :defined?, :blockarg, :op_asgn, :and_asgn, :regopt, :restarg, :resbody, :retry, :arg_expr, :kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty, diff --git a/spec/unit/mutant/mutator/node/dstr/mutation_spec.rb b/spec/unit/mutant/mutator/node/dstr/mutation_spec.rb index 08cac4d7..5e7a7c8d 100644 --- a/spec/unit/mutant/mutator/node/dstr/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/dstr/mutation_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Mutant::Mutator::Node::Generic, 'dstr' do +describe Mutant::Mutator::Node::Dstr, 'dstr' do before do Mutant::Random.stub(:hex_string => 'random') end