summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-27 14:24:33 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-27 14:24:33 +0000
commitb4eba9bba0976a1fabba7472cee69d320018250a (patch)
tree4a7b32cf6eb6ba5a46af6186dca6e5ef4e2e6b8c /lib
parent2de2b2ab2fef313a21826c514bb05d908d00b9b1 (diff)
merges revision 6057 in MiniTest's repository into ruby_1_9_2.
-- + Exit autorun via nested at_exit handler, in case other libs call git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/minitest/unit.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/minitest/unit.rb b/lib/minitest/unit.rb
index 5a69064578..0a45932079 100644
--- a/lib/minitest/unit.rb
+++ b/lib/minitest/unit.rb
@@ -497,8 +497,15 @@ module MiniTest
def self.autorun
at_exit {
next if $! # don't run if there was an exception
+
+ # the order here is important. The at_exit handler must be
+ # installed before anyone else gets a chance to install their
+ # own, that way we can be assured that our exit will be last
+ # to run (at_exit stacks).
+ exit_code = nil
+
+ at_exit { exit false if exit_code && exit_code != 0 }
exit_code = MiniTest::Unit.new.run(ARGV)
- exit false if exit_code && exit_code != 0
} unless @@installed_at_exit
@@installed_at_exit = true
end