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

44 lines
810 B
Ruby
Raw Normal View History

module Mutant
class Mutator
class Node
2013-06-04 17:43:36 -04:00
# Namespace for define mutations
class Define < self
2012-12-10 11:26:56 -05:00
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
2013-06-21 09:06:07 -04:00
emit_arguments_mutations
2014-06-16 06:56:27 -04:00
emit_body(N_RAISE)
emit_body(nil)
emit_body_mutations if body
2012-12-10 11:26:56 -05:00
end
2013-06-21 09:06:07 -04:00
# Mutator for instance method defines
2013-06-04 17:43:36 -04:00
class Instance < self
2013-06-21 09:06:07 -04:00
handle :def
2013-06-04 17:43:36 -04:00
2013-06-21 09:06:07 -04:00
children :name, :arguments, :body
2013-06-04 17:43:36 -04:00
end # Instance
2013-06-21 09:06:07 -04:00
# Mutator for singleton method defines
2013-06-04 17:43:36 -04:00
class Singleton < self
2013-06-21 09:06:07 -04:00
handle :defs
2013-06-04 17:43:36 -04:00
2013-06-21 09:06:07 -04:00
children :subject, :name, :arguments, :body
2013-06-04 17:43:36 -04:00
end # Singelton
2013-06-21 09:06:07 -04:00
end # Define
end # Node
end # Mutator
end # Mutant