2012-12-10 17:11:08 +01:00
|
|
|
module Mutant
|
|
|
|
class Mutator
|
|
|
|
class Node
|
|
|
|
# Emitter for mutations on 19 blocks
|
2013-06-04 10:25:13 +02:00
|
|
|
class Block < self
|
2012-12-10 17:11:08 +01:00
|
|
|
|
2013-06-04 10:25:13 +02:00
|
|
|
handle(:block)
|
2012-12-10 17:11:08 +01:00
|
|
|
|
2013-06-21 15:05:48 +02:00
|
|
|
children :send, :arguments, :body
|
2013-06-14 20:19:53 +02:00
|
|
|
|
|
|
|
private
|
|
|
|
|
2012-12-10 17:11:08 +01:00
|
|
|
# Emit mutants
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def dispatch
|
2014-06-05 16:37:31 +00:00
|
|
|
emit_singletons
|
2013-06-21 15:05:48 +02:00
|
|
|
emit(send)
|
2014-07-18 23:50:48 +00:00
|
|
|
emit_send_mutations(&method(:n_send?))
|
2013-06-21 15:05:48 +02:00
|
|
|
emit_arguments_mutations
|
2014-07-25 18:09:27 +00:00
|
|
|
|
|
|
|
mutate_body
|
|
|
|
end
|
|
|
|
|
|
|
|
# Emit body mutations
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def mutate_body
|
|
|
|
emit_body(nil)
|
|
|
|
emit_body(N_RAISE)
|
|
|
|
|
2014-08-05 10:50:06 +00:00
|
|
|
return unless body
|
|
|
|
emit(body)
|
|
|
|
emit_body_mutations
|
2012-12-10 17:11:08 +01:00
|
|
|
end
|
|
|
|
|
2013-06-04 10:25:13 +02:00
|
|
|
end # Block
|
|
|
|
end # Node
|
|
|
|
end # Mutator
|
|
|
|
end # Mutant
|