From: Ryan Davis Date: 2010-12-13T07:29:07+09:00 Subject: [ruby-core:33691] [Ruby 1.9-Bug#4153] Minitest or ruby bug - wrong return code Issue #4153 has been updated by Ryan Davis. Category set to lib Assigned to set to Ryan Davis I hesitate to say that this is a bug at all. It is just the way that ruby works w/ at_exit. They queue up and if someone exits inside, last exit code wins. I'm not sure what a good fix is for this. It is best reduced to: require 'rubygems' require 'minitest/autorun' class TestExitBug < MiniTest::Unit::TestCase def test_exit_bug at_exit { exit 0 } flunk end end # % ruby x.rb; echo $? # Run options: --seed 60555 # # # Running tests: # # F # # Finished tests in 0.000515s, 1941.7476 tests/s, 1941.7476 assertions/s. # # 1) Failure: # test_exit_bug(TestExitBug) [x.rb:8]: # Epic Fail! # # 1 tests, 1 assertions, 1 failures, 0 errors, 0 skips # 0 ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4153 ---------------------------------------- http://redmine.ruby-lang.org