free_mutant/lib/mutant/mutator/node/literal/array.rb
Markus Schirp 8a4fad0973 Prepend additional elements to datastructurs instead of append
* This makes it far more likely the elements are used in paralel
  assignment. Credits for idea @snusnu!
2012-12-08 01:53:54 +01:00

28 lines
538 B
Ruby

module Mutant
class Mutator
class Node
class Literal < self
# Mutator for array literals
class Array < self
handle(Rubinius::AST::ArrayLiteral)
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
emit_attribute_mutations(:body)
emit_self([])
emit_nil
emit_self([new_nil] + node.body.dup)
end
end
end
end
end
end