Sha256: b1873a65d362e76a623a19a22a22c19c741e3c344b07341949138d19f5d47d86

Contents?: true

Size: 617 Bytes

Versions: 2

Compression:

Stored size: 617 Bytes

Contents

# 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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mutant-0.3.0.rc1 lib/mutant/mutator/node/literal/boolean.rb
mutant-0.3.0.beta22 lib/mutant/mutator/node/literal/boolean.rb