free_mutant/lib/mutant/mutator/node/super.rb

36 lines
634 B
Ruby
Raw Normal View History

# encoding: utf-8
2013-01-01 17:28:21 -05:00
module Mutant
class Mutator
class Node
2013-07-23 03:58:16 -04:00
# Mutator for super with parentheses
2013-01-01 17:28:21 -05:00
class Super < self
handle(:super)
2013-01-01 17:28:21 -05:00
2013-06-14 13:55:44 -04:00
Z_SUPER = NodeHelpers.s(:zsuper)
EMPTY_SUPER = NodeHelpers.s(:super)
2013-01-01 17:28:21 -05:00
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
2013-06-14 13:55:44 -04:00
emit(Z_SUPER)
emit(EMPTY_SUPER)
children.each_index do |index|
mutate_child(index)
delete_child(index)
end
2013-01-01 17:28:21 -05:00
end
end # Super
end # Node
end # Mutator
end # Mutant