Please sign in to comment.
Use MiniTest in Ruby 1.8 if it is available.
ActiveSupport::TestCase was always inheriting from Test::Unit::TestCase. This works fine in Ruby 1.9 where Test::Unit::TestCase is a thin wrapper around MiniTest::Unit::TestCase, but does not work in Ruby 1.8 if the MiniTest gem is used. What happens is that ActiveSupport inherits from the Test::Unit::TestCase provided by the standard library, but then since Minitest is defined, it then seems to proceed on the assumption that ActiveSupport::TestCase has MiniTest::Unit::TestCase in its ancestor chain. However, in this case it does not. The fix is simply to choose which test library TestCase to inherit from using the same logic used elsewhere to detect MiniTest. I noticed this bug causing issues when using MiniTest and Mocha in Ruby 1.8, but there may well be other issues.
- Loading branch information...
Showing with 3 additions and 1 deletion.