Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#1871

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.

Matthias

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

State: committed
Milestone: none
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. DHH
    DHH
    • Assigned user set to Jeremy Kemper

    February 6th, 2009 @ 02:02 PM

  2. Jeremy Kemper
  3. Repository
    Repository
    • State changed from new to committed

    (from [86dd2f841d29b326cc480e9c58de63f54799d2c1]) Tightening the condition for including ActiveSupport::Testing::SetupAndTeardown::ForMiniTest.

    [#1871 ActiveSupport::Testing::SetupAndTeardown::ForMiniTest gets accidentally included state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

    February 6th, 2009 @ 06:06 PM