free_mutant/lib/mutant/mutator/block.rb

28 lines
451 B
Ruby
Raw Normal View History

module Mutant
class Mutator
2012-07-30 22:39:03 +02:00
# Mutator on AST blocks
2012-08-09 23:07:22 +02:00
class Block < self
handle(Rubinius::AST::Block)
private
# Emit mutants
2012-07-30 22:39:03 +02:00
#
# @return [undefined]
#
# @api private
#
def dispatch
array = node.array
emit_elements(array)
if array.length > 1
emit_element_presence(array)
else
emit_self([new_nil])
end
end
end
end
end