diff --git a/lib/mutant.rb b/lib/mutant.rb index d574a624..54fa45d6 100644 --- a/lib/mutant.rb +++ b/lib/mutant.rb @@ -212,6 +212,7 @@ require 'mutant/expression/methods' require 'mutant/expression/namespace' require 'mutant/killer' require 'mutant/test' +require 'mutant/test/report' require 'mutant/strategy' require 'mutant/runner' require 'mutant/runner/config' diff --git a/lib/mutant/test.rb b/lib/mutant/test.rb index d632f44e..b658277f 100644 --- a/lib/mutant/test.rb +++ b/lib/mutant/test.rb @@ -3,62 +3,6 @@ module Mutant class Test include AbstractType, Adamantium::Flat - # Object to report test status - class Report - include Adamantium::Flat, Anima::Update, Anima.new( - :test, - :output, - :success - ) - - # Test if test was successful - # - # @return [Boolean] - # - # @api private - # - 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] diff --git a/lib/mutant/test/report.rb b/lib/mutant/test/report.rb new file mode 100644 index 00000000..ff9a0070 --- /dev/null +++ b/lib/mutant/test/report.rb @@ -0,0 +1,59 @@ +module Mutant + class Test + # Object to report test status + class Report + include Adamantium::Flat, Anima::Update, Anima.new( + :test, + :output, + :success + ) + + # Test if test was successful + # + # @return [Boolean] + # + # @api private + # + 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 + end # Test +end # Mutant