lib/mutant/mutator/node/send.rb in mutant-0.2.4 vs lib/mutant/mutator/node/send.rb in mutant-0.2.5
- old
+ new
@@ -6,10 +6,34 @@
handle(Rubinius::AST::Send)
private
+ # Emit mutations
+ #
+ # @return [undefined]
+ #
+ # @api private
+ #
+ def dispatch
+ emit_implicit_self_receiver
+ emit_attribute_mutations(:block) if node.block
+ emit_block_absence_mutation
+ end
+
+ # Emit block absence mutation
+ #
+ # @return [undefined]
+ #
+ # @api private
+ #
+ def emit_block_absence_mutation
+ dup = dup_node
+ dup.block = nil
+ emit(dup)
+ end
+
# Return receiver AST node
#
# @return [Rubinius::AST::Node]
#
# @api private
@@ -74,19 +98,9 @@
mutant = dup_node
mutant.privately = true
# TODO: Fix rubinius to allow this as an attr_accessor
mutant.instance_variable_set(:@vcall_style, true)
emit(mutant)
- end
-
- # Emit mutations
- #
- # @return [undefined]
- #
- # @api private
- #
- def dispatch
- emit_implicit_self_receiver
end
class SendWithArguments < self
handle(Rubinius::AST::SendWithArguments)