From 610ab6e2d33d7e90f095e1bb51080838cf2c7923 Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sat, 7 Sep 2013 23:57:13 -0700 Subject: [PATCH 01/11] Fix whitespace --- .../node/named_value/constant_assignment/mutation_spec.rb | 1 - .../node/named_value/variable_assignment/mutation_spec.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/spec/unit/mutant/mutator/node/named_value/constant_assignment/mutation_spec.rb b/spec/unit/mutant/mutator/node/named_value/constant_assignment/mutation_spec.rb index 45604ed4..ceefe8c5 100644 --- a/spec/unit/mutant/mutator/node/named_value/constant_assignment/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/named_value/constant_assignment/mutation_spec.rb @@ -11,7 +11,6 @@ describe Mutant::Mutator::Node::NamedValue::VariableAssignment, 'mutations' do let(:mutations) do mutations = [] - mutations << 'SRANDOM = true' mutations << 'A = false' mutations << 'A = nil' diff --git a/spec/unit/mutant/mutator/node/named_value/variable_assignment/mutation_spec.rb b/spec/unit/mutant/mutator/node/named_value/variable_assignment/mutation_spec.rb index e06405c0..d04207a5 100644 --- a/spec/unit/mutant/mutator/node/named_value/variable_assignment/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/named_value/variable_assignment/mutation_spec.rb @@ -12,7 +12,6 @@ describe Mutant::Mutator::Node::NamedValue::VariableAssignment, 'mutations' do let(:mutations) do mutations = [] - mutations << '$srandom = true' mutations << '$a = false' mutations << '$a = nil' From 6429bdc532a5e817dadf4aaf04febf3c74402463 Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sat, 7 Sep 2013 23:57:20 -0700 Subject: [PATCH 02/11] Remove method duplicated in parent class --- lib/mutant/mutator/node/literal.rb | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lib/mutant/mutator/node/literal.rb b/lib/mutant/mutator/node/literal.rb index 02910874..38a80550 100644 --- a/lib/mutant/mutator/node/literal.rb +++ b/lib/mutant/mutator/node/literal.rb @@ -6,23 +6,6 @@ module Mutant # Abstract mutator for literal AST nodes class Literal < self include AbstractType - - private - - # Emit a new node with wrapping class for each entry in values - # - # @param [Array] values - # - # @return [undefined] - # - # @api private - # - def emit_values(values) - values.each do |value| - emit_self(value) - end - end - end # Literal end # Node end # Mutator From 1d567f65f14bbcc1c823770edc08c6f8239761cc Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sat, 7 Sep 2013 21:28:37 -0700 Subject: [PATCH 03/11] 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 From f714f8215f0c0cd8af6d13dc95ec9d4c7df8e81a Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sat, 7 Sep 2013 23:03:25 -0700 Subject: [PATCH 04/11] Add explicit mutator for op_asgn --- lib/mutant.rb | 1 + lib/mutant/mutator/node/generic.rb | 2 +- lib/mutant/mutator/node/op_asgn.rb | 30 +++++++++++++++++++ .../mutator/node/op_assgn/mutation_spec.rb | 3 +- 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 lib/mutant/mutator/node/op_asgn.rb diff --git a/lib/mutant.rb b/lib/mutant.rb index f08496e3..21febcbe 100644 --- a/lib/mutant.rb +++ b/lib/mutant.rb @@ -69,6 +69,7 @@ require 'mutant/mutator/node/named_value/access' require 'mutant/mutator/node/named_value/constant_assignment' require 'mutant/mutator/node/named_value/variable_assignment' require 'mutant/mutator/node/noop' +require 'mutant/mutator/node/op_asgn' require 'mutant/mutator/node/while' require 'mutant/mutator/node/super' require 'mutant/mutator/node/zsuper' diff --git a/lib/mutant/mutator/node/generic.rb b/lib/mutant/mutator/node/generic.rb index b2b55ce7..8e8f710f 100644 --- a/lib/mutant/mutator/node/generic.rb +++ b/lib/mutant/mutator/node/generic.rb @@ -12,7 +12,7 @@ module Mutant handle( :next, :break, :ensure, :dsym, :yield, :rescue, :redo, :defined?, - :blockarg, :op_asgn, :and_asgn, + :blockarg, :and_asgn, :regopt, :restarg, :resbody, :retry, :arg_expr, :kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty, :alias, :for, :xstr, :back_ref, :class, diff --git a/lib/mutant/mutator/node/op_asgn.rb b/lib/mutant/mutator/node/op_asgn.rb new file mode 100644 index 00000000..66437a26 --- /dev/null +++ b/lib/mutant/mutator/node/op_asgn.rb @@ -0,0 +1,30 @@ +# encoding: utf-8 + +module Mutant + class Mutator + class Node + + # OpAsgn mutator + class OpAsgn < Generic + + handle(:op_asgn) + + children :left, :right + + private + + # Emit mutations + # + # @return [undefined] + # + # @api private + # + def dispatch + super + emit_nil + end + + end # OpAsgn + end # Node + end # Mutator +end # Mutant diff --git a/spec/unit/mutant/mutator/node/op_assgn/mutation_spec.rb b/spec/unit/mutant/mutator/node/op_assgn/mutation_spec.rb index b44ddf5b..6f0429d1 100644 --- a/spec/unit/mutant/mutator/node/op_assgn/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/op_assgn/mutation_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' describe Mutant::Mutator::Node::Generic, 'op_asgn' do let(:random_fixnum) { 5 } - let(:source) { '@a.b += 1' } + let(:source) { '@a.b += 1' } let(:mutations) do mutations = [] @@ -16,6 +16,7 @@ describe Mutant::Mutator::Node::Generic, 'op_asgn' do mutations << '@a += 1' mutations << '@a.b += 5' mutations << 'nil.b += 1' + mutations << 'nil' end before do From 3eef4f117309e2a16962bce768952cdf1b2e0eeb Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sat, 7 Sep 2013 23:05:34 -0700 Subject: [PATCH 05/11] Add explicit mutator for or_asgn --- lib/mutant.rb | 1 + lib/mutant/mutator/node/generic.rb | 2 +- lib/mutant/mutator/node/or_asgn.rb | 30 +++++++++++++++++++ .../mutator/node/or_asgn/mutation_spec.rb | 3 +- .../mutant/mutator/node/send/mutation_spec.rb | 1 + 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 lib/mutant/mutator/node/or_asgn.rb diff --git a/lib/mutant.rb b/lib/mutant.rb index 21febcbe..7294ddf3 100644 --- a/lib/mutant.rb +++ b/lib/mutant.rb @@ -70,6 +70,7 @@ require 'mutant/mutator/node/named_value/constant_assignment' require 'mutant/mutator/node/named_value/variable_assignment' require 'mutant/mutator/node/noop' require 'mutant/mutator/node/op_asgn' +require 'mutant/mutator/node/or_asgn' require 'mutant/mutator/node/while' require 'mutant/mutator/node/super' require 'mutant/mutator/node/zsuper' diff --git a/lib/mutant/mutator/node/generic.rb b/lib/mutant/mutator/node/generic.rb index 8e8f710f..6d27ad77 100644 --- a/lib/mutant/mutator/node/generic.rb +++ b/lib/mutant/mutator/node/generic.rb @@ -16,7 +16,7 @@ module Mutant :regopt, :restarg, :resbody, :retry, :arg_expr, :kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty, :alias, :for, :xstr, :back_ref, :class, - :sclass, :match_with_lvasgn, :match_current_line, :or_asgn, :kwbegin + :sclass, :match_with_lvasgn, :match_current_line, :kwbegin ) private diff --git a/lib/mutant/mutator/node/or_asgn.rb b/lib/mutant/mutator/node/or_asgn.rb new file mode 100644 index 00000000..5d626b7e --- /dev/null +++ b/lib/mutant/mutator/node/or_asgn.rb @@ -0,0 +1,30 @@ +# encoding: utf-8 + +module Mutant + class Mutator + class Node + + # OrAsgn mutator + class OrAsgn < Generic + + handle(:or_asgn) + + children :left, :right + + private + + # Emit mutations + # + # @return [undefined] + # + # @api private + # + def dispatch + super + emit_nil + end + + end # OrAsgn + end # Node + end # Mutator +end # Mutant diff --git a/spec/unit/mutant/mutator/node/or_asgn/mutation_spec.rb b/spec/unit/mutant/mutator/node/or_asgn/mutation_spec.rb index e707a519..7555213a 100644 --- a/spec/unit/mutant/mutator/node/or_asgn/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/or_asgn/mutation_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Mutant::Mutator::Node::Generic, 'or_asgn' do +describe Mutant::Mutator::Node::OrAsgn, 'or_asgn' do let(:random_fixnum) { 5 } let(:random_string) { 'random' } @@ -16,6 +16,7 @@ describe Mutant::Mutator::Node::Generic, 'or_asgn' do mutations << 'a ||= -1' mutations << 'a ||= 2' mutations << 'a ||= 5' + mutations << 'nil' end before do diff --git a/spec/unit/mutant/mutator/node/send/mutation_spec.rb b/spec/unit/mutant/mutator/node/send/mutation_spec.rb index 76a538a9..7eaff09b 100644 --- a/spec/unit/mutant/mutator/node/send/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/send/mutation_spec.rb @@ -41,6 +41,7 @@ describe Mutant::Mutator, 'send' do mutations = [] mutations << 'foo ||= expression' mutations << 'nil.foo ||= expression' + mutations << 'nil' end it_should_behave_like 'a mutator' From 58e6910573006b992b6fd595b0c873dd574eced2 Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sat, 7 Sep 2013 23:39:45 -0700 Subject: [PATCH 06/11] Add explicit mutator for and_asgn --- lib/mutant.rb | 1 + lib/mutant/mutator/node/and_asgn.rb | 30 +++++++++++++++++++ lib/mutant/mutator/node/generic.rb | 2 +- .../mutator/node/and_asgn/mutation_spec.rb | 3 +- 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 lib/mutant/mutator/node/and_asgn.rb diff --git a/lib/mutant.rb b/lib/mutant.rb index 7294ddf3..81f885c4 100644 --- a/lib/mutant.rb +++ b/lib/mutant.rb @@ -59,6 +59,7 @@ require 'mutant/mutator/node/literal/array' require 'mutant/mutator/node/literal/hash' require 'mutant/mutator/node/literal/regex' require 'mutant/mutator/node/literal/nil' +require 'mutant/mutator/node/and_asgn' require 'mutant/mutator/node/argument' require 'mutant/mutator/node/arguments' require 'mutant/mutator/node/begin' diff --git a/lib/mutant/mutator/node/and_asgn.rb b/lib/mutant/mutator/node/and_asgn.rb new file mode 100644 index 00000000..99fae971 --- /dev/null +++ b/lib/mutant/mutator/node/and_asgn.rb @@ -0,0 +1,30 @@ +# encoding: utf-8 + +module Mutant + class Mutator + class Node + + # AndAsgn mutator + class AndAsgn < Generic + + handle(:and_asgn) + + children :left, :right + + private + + # Emit mutations + # + # @return [undefined] + # + # @api private + # + def dispatch + super + emit_nil + end + + end # AndAsgn + end # Node + end # Mutator +end # Mutant diff --git a/lib/mutant/mutator/node/generic.rb b/lib/mutant/mutator/node/generic.rb index 6d27ad77..6518a483 100644 --- a/lib/mutant/mutator/node/generic.rb +++ b/lib/mutant/mutator/node/generic.rb @@ -12,7 +12,7 @@ module Mutant handle( :next, :break, :ensure, :dsym, :yield, :rescue, :redo, :defined?, - :blockarg, :and_asgn, + :blockarg, :regopt, :restarg, :resbody, :retry, :arg_expr, :kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty, :alias, :for, :xstr, :back_ref, :class, diff --git a/spec/unit/mutant/mutator/node/and_asgn/mutation_spec.rb b/spec/unit/mutant/mutator/node/and_asgn/mutation_spec.rb index 72d3eec7..b9369ec3 100644 --- a/spec/unit/mutant/mutator/node/and_asgn/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/and_asgn/mutation_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Mutant::Mutator::Node::Generic, 'and_asgn' do +describe Mutant::Mutator::Node::AndAsgn, 'and_asgn' do let(:random_fixnum) { 5 } let(:random_string) { 'random' } @@ -16,6 +16,7 @@ describe Mutant::Mutator::Node::Generic, 'and_asgn' do mutations << 'a &&= -1' mutations << 'a &&= 2' mutations << 'a &&= 5' + mutations << 'nil' end before do From 475512146f928006a366cadbb3d3fb28f4dd2573 Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sat, 7 Sep 2013 23:10:25 -0700 Subject: [PATCH 07/11] Change emit_nil to not emit on the left node of an assignment * Add emit_nil to other nodes so that they can be replaced with nil, effectively removing them from the code. --- lib/mutant/mutator/node.rb | 13 ++++++- lib/mutant/mutator/node/block.rb | 1 + lib/mutant/mutator/node/case.rb | 1 + lib/mutant/mutator/node/dstr.rb | 13 +++++++ lib/mutant/mutator/node/if.rb | 1 + lib/mutant/mutator/node/masgn.rb | 2 +- .../node/named_value/variable_assignment.rb | 1 + lib/mutant/mutator/node/return.rb | 3 +- lib/mutant/mutator/node/send.rb | 1 + lib/mutant/mutator/node/super.rb | 1 + lib/mutant/mutator/node/while.rb | 1 + .../mutator/node/block/mutation_spec.rb | 5 +++ .../mutator/node/block_pass/mutation_spec.rb | 1 + .../mutant/mutator/node/case/mutation_spec.rb | 4 ++ .../node/defined_predicate/mutation_spec.rb | 8 +++- .../mutant/mutator/node/dstr/mutation_spec.rb | 2 + .../mutant/mutator/node/dsym/mutation_spec.rb | 1 + .../mutant/mutator/node/if/mutation_spec.rb | 5 +++ .../mutant/mutator/node/literal/regex_spec.rb | 6 ++- .../mutator/node/masgn/mutation_spec.rb | 8 +++- .../node/match_current_line/mutation_spec.rb | 1 + .../node/named_value/access/mutation_spec.rb | 4 ++ .../variable_assignment/mutation_spec.rb | 7 ++-- .../mutator/node/restarg/mutation_spec.rb | 2 + .../mutator/node/return/mutation_spec.rb | 10 +++-- .../mutant/mutator/node/send/mutation_spec.rb | 38 ++++++++++++++++++- .../mutator/node/super/mutation_spec.rb | 4 ++ .../mutator/node/while/mutation_spec.rb | 3 ++ 28 files changed, 129 insertions(+), 18 deletions(-) diff --git a/lib/mutant/mutator/node.rb b/lib/mutant/mutator/node.rb index 39748541..cb64967b 100644 --- a/lib/mutant/mutator/node.rb +++ b/lib/mutant/mutator/node.rb @@ -181,7 +181,7 @@ module Mutant # @api private # def emit_nil - emit(N_NIL) + emit(N_NIL) unless agsn_left? end # Return new self typed child @@ -222,6 +222,17 @@ module Mutant parent && parent.node.type end + # Test if the node is the left of an or_asgn or op_asgn + # + # @return [Boolean] + # + # @api private + # + def agsn_left? + [:or_asgn, :op_asgn, :and_asgn].include?(parent_type) && + parent.left.equal?(node) + end + end # Node end # Mutator end # Mutant diff --git a/lib/mutant/mutator/node/block.rb b/lib/mutant/mutator/node/block.rb index fecac4ba..4c17ce69 100644 --- a/lib/mutant/mutator/node/block.rb +++ b/lib/mutant/mutator/node/block.rb @@ -26,6 +26,7 @@ module Mutant end emit_body(nil) emit_body(RAISE) + emit_nil end end # Block diff --git a/lib/mutant/mutator/node/case.rb b/lib/mutant/mutator/node/case.rb index 4c42f29a..873ffb68 100644 --- a/lib/mutant/mutator/node/case.rb +++ b/lib/mutant/mutator/node/case.rb @@ -23,6 +23,7 @@ module Mutant emit_condition_mutations emit_when_mutations emit_else_mutations + emit_nil end # Emit when mutations diff --git a/lib/mutant/mutator/node/dstr.rb b/lib/mutant/mutator/node/dstr.rb index 33ba45b4..443da339 100644 --- a/lib/mutant/mutator/node/dstr.rb +++ b/lib/mutant/mutator/node/dstr.rb @@ -9,6 +9,19 @@ module Mutant handle(:dstr) + private + + # Emit mutations + # + # @return [undefined] + # + # @api private + # + def dispatch + super + emit_nil + end + end # Dstr end # Node end # Mutator diff --git a/lib/mutant/mutator/node/if.rb b/lib/mutant/mutator/node/if.rb index 8f1cc25b..31454190 100644 --- a/lib/mutant/mutator/node/if.rb +++ b/lib/mutant/mutator/node/if.rb @@ -22,6 +22,7 @@ module Mutant mutate_condition mutate_if_branch mutate_else_branch + emit_nil end # Emit conditon mutations diff --git a/lib/mutant/mutator/node/masgn.rb b/lib/mutant/mutator/node/masgn.rb index 496ee67c..2ef04c34 100644 --- a/lib/mutant/mutator/node/masgn.rb +++ b/lib/mutant/mutator/node/masgn.rb @@ -20,7 +20,7 @@ module Mutant # @api private # def dispatch - # noop, for now + emit_nil end end # MultipleAssignment diff --git a/lib/mutant/mutator/node/named_value/variable_assignment.rb b/lib/mutant/mutator/node/named_value/variable_assignment.rb index b9e03586..171bac11 100644 --- a/lib/mutant/mutator/node/named_value/variable_assignment.rb +++ b/lib/mutant/mutator/node/named_value/variable_assignment.rb @@ -30,6 +30,7 @@ module Mutant def dispatch mutate_name emit_value_mutations if value # mlhs! + emit_nil end # Emit name mutations diff --git a/lib/mutant/mutator/node/return.rb b/lib/mutant/mutator/node/return.rb index d38bc26d..33cb2b8c 100644 --- a/lib/mutant/mutator/node/return.rb +++ b/lib/mutant/mutator/node/return.rb @@ -22,9 +22,8 @@ module Mutant if value emit(value) emit_value_mutations - else - emit_nil end + emit_nil end end # Return diff --git a/lib/mutant/mutator/node/send.rb b/lib/mutant/mutator/node/send.rb index d054798a..95bad8f4 100644 --- a/lib/mutant/mutator/node/send.rb +++ b/lib/mutant/mutator/node/send.rb @@ -71,6 +71,7 @@ module Mutant else non_index_dispatch end + emit_nil end # Perform non index dispatch diff --git a/lib/mutant/mutator/node/super.rb b/lib/mutant/mutator/node/super.rb index 530482dd..d3b01367 100644 --- a/lib/mutant/mutator/node/super.rb +++ b/lib/mutant/mutator/node/super.rb @@ -27,6 +27,7 @@ module Mutant mutate_child(index) delete_child(index) end + emit_nil end end # Super diff --git a/lib/mutant/mutator/node/while.rb b/lib/mutant/mutator/node/while.rb index 853973ca..76d24886 100644 --- a/lib/mutant/mutator/node/while.rb +++ b/lib/mutant/mutator/node/while.rb @@ -23,6 +23,7 @@ module Mutant emit_condition_mutations emit_body_mutations emit_body(nil) + emit_nil end end # While diff --git a/spec/unit/mutant/mutator/node/block/mutation_spec.rb b/spec/unit/mutant/mutator/node/block/mutation_spec.rb index 0ac4de38..2c48dd9e 100644 --- a/spec/unit/mutant/mutator/node/block/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/block/mutation_spec.rb @@ -12,7 +12,10 @@ describe Mutant::Mutator, 'block' do mutations << 'foo { b }' mutations << 'foo {}' mutations << 'foo { raise }' + mutations << 'foo { a; nil }' + mutations << 'foo { nil; b }' mutations << 'foo' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -35,6 +38,7 @@ describe Mutant::Mutator, 'block' do mutations << 'foo { |a| }' mutations << 'foo { |b| }' mutations << 'foo { || }' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -61,6 +65,7 @@ describe Mutant::Mutator, 'block' do mutations << 'foo { |(a, srandom), c| }' mutations << 'foo { |(a, b), srandom| }' mutations << 'foo' + mutations << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/block_pass/mutation_spec.rb b/spec/unit/mutant/mutator/node/block_pass/mutation_spec.rb index 702f8a5d..096b3c0d 100644 --- a/spec/unit/mutant/mutator/node/block_pass/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/block_pass/mutation_spec.rb @@ -8,6 +8,7 @@ describe Mutant::Mutator::Node::NamedValue::Access, 'block_pass' do let(:mutations) do mutants = [] mutants << 'foo' + mutants << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/case/mutation_spec.rb b/spec/unit/mutant/mutator/node/case/mutation_spec.rb index 6ec98923..6a96c3bf 100644 --- a/spec/unit/mutant/mutator/node/case/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/case/mutation_spec.rb @@ -217,6 +217,8 @@ describe Mutant::Mutator::Node::Case do :else end RUBY + + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -314,6 +316,8 @@ describe Mutant::Mutator::Node::Case do :else end RUBY + + mutations << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/defined_predicate/mutation_spec.rb b/spec/unit/mutant/mutator/node/defined_predicate/mutation_spec.rb index 6ce3c8ed..a45a2db4 100644 --- a/spec/unit/mutant/mutator/node/defined_predicate/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/defined_predicate/mutation_spec.rb @@ -3,8 +3,12 @@ require 'spec_helper' describe Mutant::Mutator::Node::Generic, 'defined?' do - let(:source) { 'defined?(foo)' } - let(:mutations) { [] } + let(:source) { 'defined?(foo)' } + + let(:mutations) do + mutations = [] + mutations << 'defined?(nil)' + end it_should_behave_like 'a mutator' end diff --git a/spec/unit/mutant/mutator/node/dstr/mutation_spec.rb b/spec/unit/mutant/mutator/node/dstr/mutation_spec.rb index 5e7a7c8d..f1d29016 100644 --- a/spec/unit/mutant/mutator/node/dstr/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/dstr/mutation_spec.rb @@ -15,6 +15,8 @@ describe Mutant::Mutator::Node::Dstr, 'dstr' do mutations << '"#{nil}#{bar}baz"' mutations << '"foo#{bar}random"' mutations << '"foo#{bar}#{nil}"' + mutations << '"foo#{nil}baz"' + mutations << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/dsym/mutation_spec.rb b/spec/unit/mutant/mutator/node/dsym/mutation_spec.rb index eed07c37..1fe8f35a 100644 --- a/spec/unit/mutant/mutator/node/dsym/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/dsym/mutation_spec.rb @@ -15,6 +15,7 @@ describe Mutant::Mutator::Node::Generic, 'dsum' do mutations << ':"#{nil}#{bar}baz"' mutations << ':"foo#{bar}random"' mutations << ':"foo#{bar}#{nil}"' + mutations << ':"foo#{nil}baz"' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/if/mutation_spec.rb b/spec/unit/mutant/mutator/node/if/mutation_spec.rb index 5f0c076e..34585732 100644 --- a/spec/unit/mutant/mutator/node/if/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/if/mutation_spec.rb @@ -36,6 +36,8 @@ describe Mutant::Mutator, 'if' do # mutations of else body mutants << 'if :condition; true; else true; end' mutants << 'if :condition; true; else nil; end' + + mutants << 'nil' end it_should_behave_like 'a mutator' @@ -51,6 +53,8 @@ describe Mutant::Mutator, 'if' do mutants << 'if condition; nil; end' mutants << 'if true; true; end' mutants << 'if false; true; end' + mutants << 'if nil; true; end' + mutants << 'nil' end it_should_behave_like 'a mutator' @@ -69,6 +73,7 @@ describe Mutant::Mutator, 'if' do mutants << 'unless true; true; end' mutants << 'unless false; true; end' mutants << 'if :condition; true; end' + mutants << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/literal/regex_spec.rb b/spec/unit/mutant/mutator/node/literal/regex_spec.rb index 8a3a1dce..6f054bdc 100644 --- a/spec/unit/mutant/mutator/node/literal/regex_spec.rb +++ b/spec/unit/mutant/mutator/node/literal/regex_spec.rb @@ -9,9 +9,9 @@ describe Mutant::Mutator::Node::Literal, 'regex' do let(:mutations) do mutations = [] - mutations << 'nil' mutations << '//' # match all mutations << '/a\A/' # match nothing + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -22,10 +22,12 @@ describe Mutant::Mutator::Node::Literal, 'regex' do let(:mutations) do mutations = [] - mutations << 'nil' mutations << '//' # match all mutations << '/#{foo}n/' # match all mutations << '/a\A/' # match nothing + mutations << '/#{nil.bar}n/' + mutations << '/#{nil}n/' + mutations << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/masgn/mutation_spec.rb b/spec/unit/mutant/mutator/node/masgn/mutation_spec.rb index f1c94d63..33fc4117 100644 --- a/spec/unit/mutant/mutator/node/masgn/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/masgn/mutation_spec.rb @@ -3,8 +3,12 @@ require 'spec_helper' describe Mutant::Mutator, 'masgn' do - let(:source) { 'a, b = c, d' } - let(:mutations) { [] } + let(:source) { 'a, b = c, d' } + + let(:mutations) do + mutations = [] + mutations << 'nil' + end it_should_behave_like 'a mutator' end diff --git a/spec/unit/mutant/mutator/node/match_current_line/mutation_spec.rb b/spec/unit/mutant/mutator/node/match_current_line/mutation_spec.rb index 50e20117..21d9743b 100644 --- a/spec/unit/mutant/mutator/node/match_current_line/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/match_current_line/mutation_spec.rb @@ -14,6 +14,7 @@ describe Mutant::Mutator::Node::Generic, 'match_current_line' do mutations << 'true if nil' mutations << 'true if !//' mutations << 'true if /a\A/' + mutations << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/named_value/access/mutation_spec.rb b/spec/unit/mutant/mutator/node/named_value/access/mutation_spec.rb index 15d04bfb..18c9cc77 100644 --- a/spec/unit/mutant/mutator/node/named_value/access/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/named_value/access/mutation_spec.rb @@ -17,6 +17,7 @@ describe Mutant::Mutator::Node::NamedValue::Access, 'mutations' do mutants << '$a' mutants << '$a = ::Object.new; $a' mutants << '$srandom = nil; $a' + mutants << 'nil; $a' end it_should_behave_like 'a mutator' @@ -32,6 +33,7 @@ describe Mutant::Mutator::Node::NamedValue::Access, 'mutations' do mutants << '@@a' mutants << '@@a = ::Object.new; @@a' mutants << '@@srandom = nil; @@a' + mutants << 'nil; @@a' end end @@ -45,6 +47,7 @@ describe Mutant::Mutator::Node::NamedValue::Access, 'mutations' do mutants << '@a' mutants << '@a = ::Object.new; @a' mutants << '@srandom = nil; @a' + mutants << 'nil; @a' end it_should_behave_like 'a mutator' @@ -60,6 +63,7 @@ describe Mutant::Mutator::Node::NamedValue::Access, 'mutations' do mutants << 'a' mutants << 'a = ::Object.new; a' mutants << 'srandom = nil; a' + mutants << 'nil; a' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/named_value/variable_assignment/mutation_spec.rb b/spec/unit/mutant/mutator/node/named_value/variable_assignment/mutation_spec.rb index d04207a5..ebeed93b 100644 --- a/spec/unit/mutant/mutator/node/named_value/variable_assignment/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/named_value/variable_assignment/mutation_spec.rb @@ -15,6 +15,7 @@ describe Mutant::Mutator::Node::NamedValue::VariableAssignment, 'mutations' do mutations << '$srandom = true' mutations << '$a = false' mutations << '$a = nil' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -25,10 +26,10 @@ describe Mutant::Mutator::Node::NamedValue::VariableAssignment, 'mutations' do let(:mutations) do mutations = [] - mutations << '@@srandom = true' mutations << '@@a = false' mutations << '@@a = nil' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -39,10 +40,10 @@ describe Mutant::Mutator::Node::NamedValue::VariableAssignment, 'mutations' do let(:mutations) do mutations = [] - mutations << '@srandom = true' mutations << '@a = false' mutations << '@a = nil' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -53,10 +54,10 @@ describe Mutant::Mutator::Node::NamedValue::VariableAssignment, 'mutations' do let(:mutations) do mutations = [] - mutations << 'srandom = true' mutations << 'a = false' mutations << 'a = nil' + mutations << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/restarg/mutation_spec.rb b/spec/unit/mutant/mutator/node/restarg/mutation_spec.rb index 8d325937..9f96a1c6 100644 --- a/spec/unit/mutant/mutator/node/restarg/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/restarg/mutation_spec.rb @@ -10,6 +10,8 @@ describe Mutant::Mutator::Node::Generic, 'restarg' do mutants << 'foo' mutants << 'foo(nil)' mutants << 'foo(bar)' + mutants << 'foo(*nil)' + mutants << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/return/mutation_spec.rb b/spec/unit/mutant/mutator/node/return/mutation_spec.rb index e099041c..dfe68e2d 100644 --- a/spec/unit/mutant/mutator/node/return/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/return/mutation_spec.rb @@ -7,18 +7,22 @@ describe Mutant::Mutator, 'return' do context 'return without value' do let(:source) { 'return' } - let(:mutations) { ['nil'] } + let(:mutations) do + mutations = [] + mutations << 'nil' + end it_should_behave_like 'a mutator' end context 'return with value' do - let(:source) { 'return nil' } + let(:source) { 'return foo' } let(:mutations) do mutations = [] + mutations << 'foo' + mutations << 'return nil' mutations << 'nil' - mutations << 'return ::Object.new' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/send/mutation_spec.rb b/spec/unit/mutant/mutator/node/send/mutation_spec.rb index 7eaff09b..e9817b40 100644 --- a/spec/unit/mutant/mutator/node/send/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/send/mutation_spec.rb @@ -15,6 +15,10 @@ describe Mutant::Mutator, 'send' do mutations << 'foo.gsub(b)' mutations << 'foo.gsub' mutations << 'foo.sub(a, b)' + mutations << 'foo.gsub(a, nil)' + mutations << 'foo.gsub(nil, b)' + mutations << 'nil.gsub(a, b)' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -29,6 +33,9 @@ describe Mutant::Mutator, 'send' do mutations << 'foo.public_send(bar)' mutations << 'bar' mutations << 'foo' + mutations << 'foo.send(nil)' + mutations << 'nil.send(bar)' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -40,6 +47,7 @@ describe Mutant::Mutator, 'send' do let(:mutations) do mutations = [] mutations << 'foo ||= expression' + mutations << 'self.foo ||= nil' mutations << 'nil.foo ||= expression' mutations << 'nil' end @@ -53,6 +61,7 @@ describe Mutant::Mutator, 'send' do let(:mutations) do mutations = [] mutations << 'foo' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -66,6 +75,8 @@ describe Mutant::Mutator, 'send' do mutations << 'foo' mutations << 'foo(nil)' mutations << 'foo(bar)' + mutations << 'foo(*nil)' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -77,6 +88,7 @@ describe Mutant::Mutator, 'send' do let(:mutations) do mutations = [] mutations << 'foo' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -88,6 +100,7 @@ describe Mutant::Mutator, 'send' do let(:mutations) do mutations = [] mutations << 'foo' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -97,7 +110,12 @@ describe Mutant::Mutator, 'send' do context 'implicit' do let(:source) { 'foo' } - it_should_behave_like 'a noop mutator' + let(:mutations) do + mutations = [] + mutations << 'nil' + end + + it_should_behave_like 'a mutator' end context 'explict receiver' do @@ -108,6 +126,7 @@ describe Mutant::Mutator, 'send' do mutations << 'foo' mutations << 'self' mutations << 'nil.foo' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -133,6 +152,8 @@ describe Mutant::Mutator, 'send' do let(:mutations) do mutations = [] mutations << 'foo' + mutations << 'nil.bar' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -146,6 +167,8 @@ describe Mutant::Mutator, 'send' do mutations << 'self.class' mutations << 'self.foo' mutations << 'nil.class.foo' + mutations << 'nil.foo' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -192,8 +215,9 @@ describe Mutant::Mutator, 'send' do mutations = [] mutations << "foo.#{keyword}" mutations << 'foo' - mutations << 'nil' mutations << "foo.#{keyword}(::Object.new)" + mutations << "nil.#{keyword}(nil)" + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -210,6 +234,7 @@ describe Mutant::Mutator, 'send' do mutations << 'foo(nil)' mutations << 'foo(::Object.new, nil)' mutations << 'foo(nil, ::Object.new)' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -225,6 +250,11 @@ describe Mutant::Mutator, 'send' do mutations << '(left - right)' mutations << 'left / foo' mutations << 'right / foo' + mutations << '(left - right) / nil' + mutations << '(left - nil) / foo' + mutations << '(nil - right) / foo' + mutations << 'nil / foo' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -242,6 +272,7 @@ describe Mutant::Mutator, 'send' do mutations << "true #{operator} nil" mutations << 'true' mutations << 'false' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -253,6 +284,9 @@ describe Mutant::Mutator, 'send' do mutations = [] mutations << 'left' mutations << 'right' + mutations << "left #{operator} nil" + mutations << "nil #{operator} right" + mutations << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/super/mutation_spec.rb b/spec/unit/mutant/mutator/node/super/mutation_spec.rb index 47304065..f4152d64 100644 --- a/spec/unit/mutant/mutator/node/super/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/super/mutation_spec.rb @@ -21,6 +21,7 @@ describe Mutant::Mutator, 'super' do let(:mutations) do mutations = [] mutations << 'super' + mutations << 'nil' end it_should_behave_like 'a mutator' @@ -35,6 +36,9 @@ describe Mutant::Mutator, 'super' do mutations << 'super()' mutations << 'super(foo)' mutations << 'super(bar)' + mutations << 'super(foo, nil)' + mutations << 'super(nil, bar)' + mutations << 'nil' end it_should_behave_like 'a mutator' diff --git a/spec/unit/mutant/mutator/node/while/mutation_spec.rb b/spec/unit/mutant/mutator/node/while/mutation_spec.rb index 1b220ad7..3a8bb319 100644 --- a/spec/unit/mutant/mutator/node/while/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/while/mutation_spec.rb @@ -14,6 +14,9 @@ describe Mutant::Mutator::Node::While do mutations << 'while true; end' mutations << 'while false; foo; bar; end' mutations << 'while nil; foo; bar; end' + mutations << 'while true; foo; nil; end' + mutations << 'while true; nil; bar; end' + mutations << 'nil' end it_should_behave_like 'a mutator' From 68d0fc42ab673f0239b8f51e17d047e49a076085 Mon Sep 17 00:00:00 2001 From: Dan Kubb Date: Sun, 8 Sep 2013 00:25:50 -0700 Subject: [PATCH 08/11] Update flay threshold --- config/flay.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/flay.yml b/config/flay.yml index 3fe9e1f5..7c0f54a8 100644 --- a/config/flay.yml +++ b/config/flay.yml @@ -1,3 +1,3 @@ --- -threshold: 16 -total_score: 762 +threshold: 18 +total_score: 752 From fbebca0163c241ff300b6589893174f7694e32aa Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Sun, 8 Sep 2013 11:27:35 +0200 Subject: [PATCH 09/11] Cleanup Matcher::File It landed accidentally in the prev commit. --- lib/mutant/matcher/filter.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mutant/matcher/filter.rb b/lib/mutant/matcher/filter.rb index 944be81a..8621d51c 100644 --- a/lib/mutant/matcher/filter.rb +++ b/lib/mutant/matcher/filter.rb @@ -10,7 +10,7 @@ module Mutant # if block given # # @return [Enumerator] - # oherwise + # otherwise # # @api private # @@ -19,12 +19,12 @@ module Mutant matcher.each do |subject| next if filter.match?(subject) - yield matcher + yield subject end self end end # Filter - end + end # Matcher end # Mutant From 2c7ef7804c3a70c1a4b140f844bc6d307961dde6 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Sun, 8 Sep 2013 11:37:53 +0200 Subject: [PATCH 10/11] Prefer constant over literal array --- lib/mutant/constants.rb | 3 ++- lib/mutant/mutator/node.rb | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mutant/constants.rb b/lib/mutant/constants.rb index b0f48368..e515e635 100644 --- a/lib/mutant/constants.rb +++ b/lib/mutant/constants.rb @@ -15,7 +15,7 @@ module Mutant # Set of op assign types OP_ASSIGN = [ - :or_asgn, :and_asgn + :or_asgn, :and_asgn, :op_asgn ].to_set.freeze # Set of node types that are not valid when emitted standalone @@ -64,6 +64,7 @@ module Mutant OPERATOR_METHODS = OPERATOR_EXPANSIONS.keys + INDEX_OPERATORS + UNARY_METHOD_OPERATORS + # Hopefully all types parser does generate NODE_TYPES = [ :lvasgn, :ivasgn, :cvasgn, :gvasgn, diff --git a/lib/mutant/mutator/node.rb b/lib/mutant/mutator/node.rb index cb64967b..d154fb87 100644 --- a/lib/mutant/mutator/node.rb +++ b/lib/mutant/mutator/node.rb @@ -229,8 +229,7 @@ module Mutant # @api private # def agsn_left? - [:or_asgn, :op_asgn, :and_asgn].include?(parent_type) && - parent.left.equal?(node) + OP_ASSIGN.include?(parent_type) && parent.left.equal?(node) end end # Node From 8815f53a2e2a88fb502e4451cda74ef1290efb1c Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Sun, 8 Sep 2013 11:45:00 +0200 Subject: [PATCH 11/11] Collapse op_assign emitters into one --- lib/mutant.rb | 2 -- lib/mutant/mutator/node/and_asgn.rb | 30 ------------------- lib/mutant/mutator/node/op_asgn.rb | 2 +- lib/mutant/mutator/node/or_asgn.rb | 30 ------------------- .../mutator/node/and_asgn/mutation_spec.rb | 2 +- .../mutator/node/or_asgn/mutation_spec.rb | 2 +- 6 files changed, 3 insertions(+), 65 deletions(-) delete mode 100644 lib/mutant/mutator/node/and_asgn.rb delete mode 100644 lib/mutant/mutator/node/or_asgn.rb diff --git a/lib/mutant.rb b/lib/mutant.rb index 81f885c4..21febcbe 100644 --- a/lib/mutant.rb +++ b/lib/mutant.rb @@ -59,7 +59,6 @@ require 'mutant/mutator/node/literal/array' require 'mutant/mutator/node/literal/hash' require 'mutant/mutator/node/literal/regex' require 'mutant/mutator/node/literal/nil' -require 'mutant/mutator/node/and_asgn' require 'mutant/mutator/node/argument' require 'mutant/mutator/node/arguments' require 'mutant/mutator/node/begin' @@ -71,7 +70,6 @@ require 'mutant/mutator/node/named_value/constant_assignment' require 'mutant/mutator/node/named_value/variable_assignment' require 'mutant/mutator/node/noop' require 'mutant/mutator/node/op_asgn' -require 'mutant/mutator/node/or_asgn' require 'mutant/mutator/node/while' require 'mutant/mutator/node/super' require 'mutant/mutator/node/zsuper' diff --git a/lib/mutant/mutator/node/and_asgn.rb b/lib/mutant/mutator/node/and_asgn.rb deleted file mode 100644 index 99fae971..00000000 --- a/lib/mutant/mutator/node/and_asgn.rb +++ /dev/null @@ -1,30 +0,0 @@ -# encoding: utf-8 - -module Mutant - class Mutator - class Node - - # AndAsgn mutator - class AndAsgn < Generic - - handle(:and_asgn) - - children :left, :right - - private - - # Emit mutations - # - # @return [undefined] - # - # @api private - # - def dispatch - super - emit_nil - end - - end # AndAsgn - end # Node - end # Mutator -end # Mutant diff --git a/lib/mutant/mutator/node/op_asgn.rb b/lib/mutant/mutator/node/op_asgn.rb index 66437a26..5677d4f9 100644 --- a/lib/mutant/mutator/node/op_asgn.rb +++ b/lib/mutant/mutator/node/op_asgn.rb @@ -7,7 +7,7 @@ module Mutant # OpAsgn mutator class OpAsgn < Generic - handle(:op_asgn) + handle(:op_asgn, :or_asgn, :and_asgn) children :left, :right diff --git a/lib/mutant/mutator/node/or_asgn.rb b/lib/mutant/mutator/node/or_asgn.rb deleted file mode 100644 index 5d626b7e..00000000 --- a/lib/mutant/mutator/node/or_asgn.rb +++ /dev/null @@ -1,30 +0,0 @@ -# encoding: utf-8 - -module Mutant - class Mutator - class Node - - # OrAsgn mutator - class OrAsgn < Generic - - handle(:or_asgn) - - children :left, :right - - private - - # Emit mutations - # - # @return [undefined] - # - # @api private - # - def dispatch - super - emit_nil - end - - end # OrAsgn - end # Node - end # Mutator -end # Mutant diff --git a/spec/unit/mutant/mutator/node/and_asgn/mutation_spec.rb b/spec/unit/mutant/mutator/node/and_asgn/mutation_spec.rb index b9369ec3..b9eb2390 100644 --- a/spec/unit/mutant/mutator/node/and_asgn/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/and_asgn/mutation_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Mutant::Mutator::Node::AndAsgn, 'and_asgn' do +describe Mutant::Mutator::Node::OpAsgn, 'and_asgn' do let(:random_fixnum) { 5 } let(:random_string) { 'random' } diff --git a/spec/unit/mutant/mutator/node/or_asgn/mutation_spec.rb b/spec/unit/mutant/mutator/node/or_asgn/mutation_spec.rb index 7555213a..063bf6df 100644 --- a/spec/unit/mutant/mutator/node/or_asgn/mutation_spec.rb +++ b/spec/unit/mutant/mutator/node/or_asgn/mutation_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Mutant::Mutator::Node::OrAsgn, 'or_asgn' do +describe Mutant::Mutator::Node::OpAsgn, 'or_asgn' do let(:random_fixnum) { 5 } let(:random_string) { 'random' }