Sha256: b0513a94c49f386830dfadf343136721d8d49d63065688f46e5bcdf8746d0b57

Contents?: true

Size: 1.41 KB

Versions: 2

Compression:

Stored size: 1.41 KB

Contents

# encoding: utf-8

module Mutant
  class Mutation
    # Neutral mutation
    class Neutral < self

      SYMBOL = 'neutral'

      # Noop mutation, special case of neutral
      class Noop < self

        SYMBOL = 'noop'

        # Indicate if a killer should treat a kill as problematic
        #
        # @return [false] Killing noop mutants is a serious problem. Failures
        #   in noop may indicate a broken test suite, but they can also be an
        #   indication  mutant has altered the runtime environment in a subtle
        #   way and tickled an odd bug
        #
        # @api private
        #
        def should_survive?
          false
        end

      end

      # Return identification
      #
      # @return [String]
      #
      # @api private
      #
      def identification
        "#{self.class::SYMBOL}:#{super}"
      end
      memoize :identification

      # Test if killer is successful
      #
      # @param [Killer] killer
      #
      # @return [true]
      #   if killer did NOT killed mutation
      #
      # @return [false]
      #   otherwise
      #
      # @api private
      #
      def success?(killer)
        !killer.killed?
      end

      # Indicate if a killer should treat a kill as problematic
      #
      # @return [true] Neutral mutants must die
      #
      # @api private
      #
      def should_survive?
        false
      end

    end # Neutral
  end # Mutation
end # Mutant

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mutant-0.3.0.rc1 lib/mutant/mutation/neutral.rb
mutant-0.3.0.beta22 lib/mutant/mutation/neutral.rb