Move Test::Report to own file

This commit is contained in:
Markus Schirp 2014-06-28 22:37:48 +00:00
parent 390086f17d
commit ca967c8774
3 changed files with 60 additions and 56 deletions

View file

@ -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'

View file

@ -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]

59
lib/mutant/test/report.rb Normal file
View file

@ -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