Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support for Test::Unit 2.1 #18

Closed
wants to merge 1 commit into from

4 participants

@amfranz

CI_Reporter currently does not work with Test::Unit 2.1 because the code path for creating the mediator, which CI_Reporter hooks into, changed between Test::Unit 2.0 and 2.1.

The attached pull request contains a change to test_unit_loader.rb that allows CI_Reporter to hook into Test::Unit 2.1, without breaking support for older versions of Test::Unit.

@amfranz amfranz Adjusting the logic to install the CI::Reporter::TestUnit mediator so…
… that it will work for newer ruby-test versions (>= 2.1) as well.
5d9ba36
@cbrunnkvist

Hey, it works again, thanks a lot! :-) I had yet to figure out that it was a version issue.

@yairgo

will you please pull this in

@nicksieger
Owner

Is this all that's needed for T::U 2.1? I haven't been using it myself. I am happy to push a new gem with just this change if it's really so simple :)

@nicksieger nicksieger closed this
@yairgo

I believe so. If you push up a gem I'll test it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 25, 2010
  1. @amfranz

    Adjusting the logic to install the CI::Reporter::TestUnit mediator so…

    amfranz authored
    … that it will work for newer ruby-test versions (>= 2.1) as well.
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/ci/reporter/rake/test_unit_loader.rb
View
16 lib/ci/reporter/rake/test_unit_loader.rb
@@ -1,3 +1,4 @@
+
# Copyright (c) 2006-2010 Nick Sieger <nicksieger@gmail.com>
# See the file LICENSE.txt included with the distribution for
# software license details.
@@ -5,6 +6,7 @@
$: << File.dirname(__FILE__) + "/../../.."
require 'ci/reporter/test_unit'
+# Intercepts mediator creation in ruby-test < 2.1
module Test #:nodoc:all
module Unit
module UI
@@ -19,3 +21,17 @@ def create_mediator(suite)
end
end
end
+
+# Intercepts mediator creation in ruby-test >= 2.1
+module Test #:nodoc:all
+ module Unit
+ module UI
+ class TestRunner
+ def setup_mediator
+ # swap in our custom mediator
+ @mediator = CI::Reporter::TestUnit.new(@suite)
+ end
+ end
+ end
+ end
+end
Something went wrong with that request. Please try again.