aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing
diff options
context:
space:
mode:
authorJames Mead <james@floehopper.org>2012-05-29 11:14:50 +0100
committerJames Mead <james@floehopper.org>2012-05-29 11:14:50 +0100
commit0813b45127c2dfc958482bba8fe1e3281866188d (patch)
tree51f8be789e568d6deaad402925d1d5e16234f3ed /activesupport/lib/active_support/testing
parent0e69705b0fc7501bada74b3ca023ae7f7b2b8592 (diff)
downloadrails-0813b45127c2dfc958482bba8fe1e3281866188d.tar.gz
rails-0813b45127c2dfc958482bba8fe1e3281866188d.tar.bz2
rails-0813b45127c2dfc958482bba8fe1e3281866188d.zip
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.
Diffstat (limited to 'activesupport/lib/active_support/testing')
-rw-r--r--activesupport/lib/active_support/testing/setup_and_teardown.rb5
1 files changed, 5 insertions, 0 deletions
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