free_mutant/lib/mutant/mutator/node/literal/boolean.rb
Dan Kubb 7293386c26 Add magic encoding header to all ruby files
* rubocop still warns about this on ruby 1.9.3, so it was fixed so
  it produces less output on travis.
2013-07-28 16:03:06 -07:00

34 lines
617 B
Ruby

# encoding: utf-8
module Mutant
class Mutator
class Node
class Literal < self
# Abstract mutator for boolean literals
class Boolean < self
private
MAP = {
:true => :false,
:false => :true
}.freeze
handle(*MAP.keys)
# Emit mutants
#
# @return [undefined]
#
# @api private
#
def dispatch
emit_nil
emit(s(MAP.fetch(node.type)))
end
end # Boolean
end # Literal
end # Node
end # Mutatork
end # Mutant