This project is archived and is in readonly mode.

#1871 ✓committed
Matthias Hennemeyer

ActiveSupport::Testing::SetupAndTeardown::ForMiniTest gets accidentally included

Reported by Matthias Hennemeyer | February 4th, 2009 @ 10:00 AM

In active_support/testing/setup_and_teardown.rb:11, there is a conditional that decides on the value of defined?(MiniTest) if ForMiniTest or ForClassicTestUnit will be included.

If there are both minitest and mocha present (as gems), the mentioned decision will always be taken in favor of MiniTest, because mocha requires minitest/unit (if it is present).

This situation will yield an error when ForMiniTest#run tells the TestUnit Result to puke. Because this is something only the MiniTest Runner is capable of.

The attached patch tightens the condition for ActiveSupport::Testing::SetupAndTeardown::ForMiniTest to be included into ActiveSupport::Testing::SetupAndTeardown. Instead of just looking for MiniTest it checks if MiniTest::Assertions are included into TestCase.

I'have tested it with ruby 1.8.6, edge rails (b302e023) and both plain t/u and minitest_tu_shim compatibility mode.


Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket