Sha256: dd1bfcf0087de93d5c5ced50fb3f750eacbf540af60c49384f788c1ca3926fc4

Contents?: true

Size: 1.66 KB

Versions: 11

Compression:

Stored size: 1.66 KB

Contents

module Mutant
  # Abstract base class for test that might kill a mutation
  class Test
    include AbstractType, Adamantium::Flat

    # Object to report test status
    class Report
      include Adamantium::Flat, Anima::Update, Anima.new(
        :test,
        :output,
        :success
      )

      alias_method :success?, :success

      # Test if test failed
      #
      # @return [Boolean]
      #
      # @api private
      #
      def failed?
        !success?
      end

      # Return marshallable data
      #
      # NOTE:
      #
      #  The test is intentionally NOT part of the mashalled data.
      #  In rspec the example group cannot deterministically being marshalled, because
      #  they reference a crazy mix of IO objects, global objects etc.
      #
      # @return [Array]
      #
      # @api private
      #
      def marshal_dump
        [@output, @success]
      end

      # Load marshalled data
      #
      # @param [Array] arry
      #
      # @return [undefined]
      #
      # @api private
      #
      def marshal_load(array)
        @output, @success = array
      end

    end # Report

    # Run tests
    #
    # @return [Test::Result]
    #
    # @api private
    #
    abstract_method :run

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

    # Return subject identification
    #
    # This method is used for current mutants primitive test selection.
    #
    # @return [String]
    #
    # @api private
    #
    abstract_method :subject_identification

  end # Test
end # Mutant

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mutant-0.5.23 lib/mutant/test.rb
mutant-0.5.22 lib/mutant/test.rb
mutant-0.5.21 lib/mutant/test.rb
mutant-0.5.20 lib/mutant/test.rb
mutant-0.5.19 lib/mutant/test.rb
mutant-0.5.18 lib/mutant/test.rb
mutant-0.5.17 lib/mutant/test.rb
mutant-0.5.16 lib/mutant/test.rb
mutant-0.5.15 lib/mutant/test.rb
mutant-0.5.14 lib/mutant/test.rb
mutant-0.5.13 lib/mutant/test.rb