Issue #5197 has been updated by Ryan Davis.

Assignee changed from Ryan Davis to Motohiro KOSAKI

That discussion makes my head hurt.

What I need is this:

1) minitest, like test/unit before it, runs its tests via at_exit.
2) Users need to be able to register code to run AFTER the tests run (for extra reporting, or resource cleanup). This was usually done with:

    at_exit { at_exit { codes } }

which I wrapped up in a method called #after_tests(&b).

Now that doesn't work. I need some mechanism to make this work as its been available this way for 10+ years. I don't care what mechanism I wind up using, as long as it works.

See https://github.com/seattlerb/minitest/issues/25 for more info.
----------------------------------------
Bug #5197: at_exit order has changed in 1.9.3dev32413
http://redmine.ruby-lang.org/issues/5197

Author: Ryan Davis
Status: Feedback
Priority: Normal
Assignee: Motohiro KOSAKI
Category: core
Target version: 1.9.3
ruby -v: 1.9.3dev32413


I could have sworn I filed or mailed this before, but I can't find it. Sorry if this is a dupe.

#!/usr/bin/ruby -w

happy = false
at_exit { happy = true }                                # test runner
at_exit { at_exit { abort "not happy!" unless happy } } # after test hook

# multiruby produces:

# VERSION = mri_trunk
# CMD     = ~/.multiruby/install/mri_trunk/bin/ruby -v -Ilib bug4.rb
#
# ruby 1.9.3dev (2011-07-05 trunk 32413) [x86_64-darwin10.8.0]
# not happy!
#
# RESULT = 256
#
# VERSION = 1.8.7-p330
# CMD     = ~/.multiruby/install/1.8.7-p330/bin/ruby -v -Ilib bug4.rb
#
# ruby 1.8.7 (2010-12-23 patchlevel 330) [i686-darwin10.5.0]
#
# RESULT = 0
#
# VERSION = 1.9.2-p136
# CMD     = ~/.multiruby/install/1.9.2-p136/bin/ruby -v -Ilib bug4.rb
#
# ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0]
#
# RESULT = 0
#
# TOTAL RESULT = 1 failures out of 3



-- 
http://redmine.ruby-lang.org