Class: CI::Reporter::Failure

Inherits:
Object
  • Object
show all
Defined in:
lib/ci/reporter/test_unit.rb

Overview

Factory for constructing either a CI::Reporter::TestUnitFailure or CI::Reporter::TestUnitError depending on the result of the test.

Class Method Summary collapse

Class Method Details

.new(fault) ⇒ Object



14
15
16
17
18
# File 'lib/ci/reporter/test_unit.rb', line 14

def self.new(fault)
  return TestUnitFailure.new(fault) if fault.kind_of?(Test::Unit::Failure)
  return TestUnitSkipped.new(fault) if Test::Unit.constants.include?("Omission") && (fault.kind_of?(Test::Unit::Omission) || fault.kind_of?(Test::Unit::Pending))
  TestUnitError.new(fault)
end