Sha256: 5557be03935693fa2e63da8168c220d0667be83a2bd0a13d5c97cebef1595caf

Contents?: true

Size: 824 Bytes

Versions: 4

Compression:

Stored size: 824 Bytes

Contents

module Mutant
  class Mutator
    class Node
      # Mutator on AST blocks
      class Block < self

        handle(Rubinius::AST::Block)

      private

        # Emit mutants
        #
        # @return [undefined]
        #
        # @api private
        #
        def dispatch
          array = input.array
          emit_attribute_mutations(:array)
        end

        # Test if node is new
        #
        # FIXME: Remove this hack and make sure empty bodies are not generated
        #
        # @param [Rubinius::AST::Node]
        #
        # @return [true]
        #   if node is new
        #
        # @return [false]
        #   otherwise
        #
        def new?(node)
          if node.array.empty?
            node.array << new_nil
          end

          super
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mutant-0.2.4 lib/mutant/mutator/node/block.rb
mutant-0.2.3 lib/mutant/mutator/node/block.rb
mutant-0.2.2 lib/mutant/mutator/node/block.rb
mutant-0.2.1 lib/mutant/mutator/node/block.rb