free_mutant/lib/mutant/mutator/literal/empty_array.rb
Markus Schirp 75e6a229f8 Create namespace for literal mutations
* Do not follow rubinius names anymore.
  An explict declaration now declares a mutator handles
  specific AST node.

* Has a nice impact on metrics.
2012-07-31 19:45:46 +02:00

24 lines
432 B
Ruby

module Mutant
class Mutator
class Literal < Mutator
# Mutator for empty array literals
class EmptyArray < Literal
handle(Rubinius::AST::EmptyArray)
private
# Emit mutants
#
# @return [undefined]
#
# @api private
#
def dispatch
emit_nil
emit(Rubinius::AST::ArrayLiteral, [new_nil])
end
end
end
end
end