seattlerb/minitest — pull request #84 by ysbaddaden (2012-01-08 21:34:28+00:00)
Title: Fixed MiniTest::Unit.after_tests under Ruby 1.9.3

MiniTest::Unit.after_tests is broken since MRI Ruby changed the behavior of `at_exit` in 1.9.3 as reported in issue #25. Here is a proposed fix which stacks the blocks, and calls them manually in the last `at_exit`.

One caveat is that if `test/unit` happens to be loaded before MiniTest's autorun, then after tests won't be called, since test/unit uses it's own autorun method. This is fixable by making sure `minitest/autorun` is loaded first —in the Gemfile or in the test helper. Fixing test/unit to call MiniTest::Unit.run_after_tests_hooks is also a solution.