free_mutant/lib/mutant/mutator/node/send/attribute_assignment.rb
2014-06-15 13:12:11 +00:00

47 lines
986 B
Ruby

module Mutant
class Mutator
class Node
class Send
# Mutator for attribute assignments
class AttributeAssignment < self
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
normal_dispatch
emit_attribute_read
end
# Mutate arguments
#
# @return [undefined]
#
# @api private
#
def mutate_arguments
remaining_children_indices.each do |index|
mutate_child(index)
end
end
# Emit attribute read
#
# @return [undefined]
#
# @api private
#
def emit_attribute_read
emit_type(receiver, selector.to_s[0..-2].to_sym)
end
end # AttributeAssignment
end # Send
end # Node
end # Mutator
end # Mutant