From a144fccdc5a35472a32f042904080bb2b128b9fb Mon Sep 17 00:00:00 2001 From: Nick Sieger Date: Wed, 14 Dec 2011 11:37:20 -0600 Subject: [PATCH] Match on class name so we don't pollute env with test/unit Fixes #47. --- lib/ci/reporter/test_suite.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/ci/reporter/test_suite.rb b/lib/ci/reporter/test_suite.rb index 2b3f188..0f24239 100644 --- a/lib/ci/reporter/test_suite.rb +++ b/lib/ci/reporter/test_suite.rb @@ -1,12 +1,10 @@ -# Copyright (c) 2006-2010 Nick Sieger +# Copyright (c) 2006-2011 Nick Sieger # See the file LICENSE.txt included with the distribution for # software license details. require 'delegate' require 'stringio' -require 'ci/reporter/test_unit' - module CI module Reporter # Emulates/delegates IO to $stdout or $stderr in order to capture output to report in the XML file. @@ -140,9 +138,9 @@ def to_xml(builder) builder.skipped else failures.each do |failure| - tag = case failure - when TestUnitSkipped then :skipped - when TestUnitError then :error + tag = case failure.class.name + when /TestUnitSkipped/ then :skipped + when /TestUnitError/ then :error else :failure end builder.tag!(tag, :type => builder.trunc!(failure.name), :message => builder.trunc!(failure.message)) do