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

33 lines
567 B
Ruby
Raw Normal View History

module Mutant
class Mutator
class Node
# Emitter for mutations on 19 blocks
class Block < self
handle(:block)
2013-06-21 09:05:48 -04:00
children :send, :arguments, :body
2013-06-14 14:19:53 -04:00
private
# Emit mutants
#
# @return [undefined]
#
# @api private
#
def dispatch
2013-06-21 09:05:48 -04:00
emit(send)
emit_arguments_mutations
if body
emit_body_mutations
else
emit_body(NEW_OBJECT)
end
end
end # Block
end # Node
end # Mutator
end # Mutant