Skip to content
Browse files

Support for Test::Unit 2.0 notifications.

  • Loading branch information...
1 parent ece2abc commit 398ce62300579e2ddff0fe1f4bca4cbcb2eb733f @amfranz committed Jan 14, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/ci/reporter/test_unit.rb
View
11 lib/ci/reporter/test_unit.rb
@@ -14,6 +14,7 @@ class Failure
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))
+ return TestUnitNotification.new(fault) if Test::Unit.constants.include?("Notification") && fault.kind_of?(Test::Unit::Notification)
TestUnitError.new(fault)
end
end
@@ -48,6 +49,16 @@ def message() @fault.message end
def location() @fault.location.join("\n") end
end
+ # Wrapper around a <code>Test::Unit</code> 2.0 notification.
+ class TestUnitNotification
+ def initialize(fault) @fault = fault end
+ def failure?() false end
+ def error?() false end
+ def name() Test::Unit::Notification.name end
+ def message() @fault.message end
+ def location() @fault.location.join("\n") end
+ end
+
# Replacement Mediator that adds listeners to capture the results of the <code>Test::Unit</code> runs.
class TestUnit < Test::Unit::UI::TestRunnerMediator
def initialize(suite, report_mgr = nil)

0 comments on commit 398ce62

Please sign in to comment.
Something went wrong with that request. Please try again.