Move Test::Report to own file
This commit is contained in:
parent
390086f17d
commit
ca967c8774
3 changed files with 60 additions and 56 deletions
|
@ -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'
|
||||
|
|
|
@ -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
59
lib/mutant/test/report.rb
Normal 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
|
Loading…
Add table
Reference in a new issue