From 0813b45127c2dfc958482bba8fe1e3281866188d Mon Sep 17 00:00:00 2001 From: James Mead Date: Tue, 29 May 2012 11:14:50 +0100 Subject: Exceptions like Interrupt should not be rescued in tests. This is a back-port of rails/rails#6525. See the commit notes there for details. --- activesupport/lib/active_support/testing/setup_and_teardown.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/lib/active_support/testing') diff --git a/activesupport/lib/active_support/testing/setup_and_teardown.rb b/activesupport/lib/active_support/testing/setup_and_teardown.rb index 22e41fa905..78d914f8cf 100644 --- a/activesupport/lib/active_support/testing/setup_and_teardown.rb +++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb @@ -28,17 +28,22 @@ module ActiveSupport end module ForMiniTest + PASSTHROUGH_EXCEPTIONS = MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS rescue [NoMemoryError, SignalException, Interrupt, SystemExit] def run(runner) result = '.' begin run_callbacks :setup do result = super end + rescue *PASSTHROUGH_EXCEPTIONS => e + raise e rescue Exception => e result = runner.puke(self.class, method_name, e) ensure begin run_callbacks :teardown + rescue *PASSTHROUGH_EXCEPTIONS => e + raise e rescue Exception => e result = runner.puke(self.class, method_name, e) end -- cgit v1.2.3