Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Run MiniTest tests in both 1.8 and 1.9 #21

Closed
wants to merge 1 commit into from

2 participants

@jasonm

Pullreq'd upstream in Zeus burke/zeus#146

@jasonm jasonm Run MiniTest tests in both 1.8 and 1.9
* In the minitest gem (used only on Ruby 1.8),
  MiniTest::Unit.runner delegates to MiniTest::Unit.new and memoizes the
  result.  This method is not available in the Ruby 1.9 stdlib minitest,
  so we just instantiate a new MiniTest::Unit for cross-compatibility.

* In 1.8, class method MiniTest::Unit.runner:
  https://github.com/seattlerb/minitest/blob/bdbf38df3475dcc8ddd6d11ebede48cdd5f55008/lib/minitest/unit.rb#L808-815

* In 1.9, get a runner instance by constructing a new
* MiniTest::Unit:
  https://github.com/ruby/ruby/blob/v1_9_2_381/lib/minitest/unit.rb#L551-L590
  https://github.com/ruby/ruby/blob/v1_9_3_286/lib/minitest/unit.rb#L531-L883
f6a8048
@qrush
Owner

I'm not interested in supporting 1.8. :hammer:

@qrush qrush closed this
@aripollak aripollak referenced this pull request in burke/zeus
Closed

Fix running Test::Unit under Ruby 1.9.3 #253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 25, 2012
  1. @jasonm

    Run MiniTest tests in both 1.8 and 1.9

    jasonm authored
    * In the minitest gem (used only on Ruby 1.8),
      MiniTest::Unit.runner delegates to MiniTest::Unit.new and memoizes the
      result.  This method is not available in the Ruby 1.9 stdlib minitest,
      so we just instantiate a new MiniTest::Unit for cross-compatibility.
    
    * In 1.8, class method MiniTest::Unit.runner:
      https://github.com/seattlerb/minitest/blob/bdbf38df3475dcc8ddd6d11ebede48cdd5f55008/lib/minitest/unit.rb#L808-815
    
    * In 1.9, get a runner instance by constructing a new
    * MiniTest::Unit:
      https://github.com/ruby/ruby/blob/v1_9_2_381/lib/minitest/unit.rb#L551-L590
      https://github.com/ruby/ruby/blob/v1_9_3_286/lib/minitest/unit.rb#L531-L883
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/m.rb
View
2  lib/m.rb
@@ -188,7 +188,7 @@ def execute
# directly run the tests from here and exit with the status of the tests passing or failing
if defined?(MiniTest)
- exit MiniTest::Unit.runner.run test_arguments
+ exit MiniTest::Unit.new.run test_arguments
elsif defined?(Test)
exit Test::Unit::AutoRunner.run(false, nil, test_arguments)
else
Something went wrong with that request. Please try again.