free_mutant/lib/mutant/mutator/node/defined.rb
Markus Schirp 3ae85ea0f9 Refactor and consolidate node type checks in to private methods
* Before Symbol#==, Symbol#eql?, and Symbol#equal? where used
  inconsistently
* Lots of redundant foo.type.equal?(:symbol)
2014-06-10 02:06:00 +00:00

28 lines
477 B
Ruby

module Mutant
class Mutator
class Node
# Namespace for define mutations
class Defined < self
handle(:defined?)
children :expression
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
emit_expression_mutations do |node|
!n_self?(node)
end
end
end # Defined
end # Node
end # Mutator
end # Mutant