aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-05-29 01:35:40 -0700
committerJosé Valim <jose.valim@gmail.com>2012-05-29 01:35:40 -0700
commit6ba93ac6f6fa873c510a084c6f178390939841e9 (patch)
tree07d7e5775de0b4be0bb2bc3b13a05ff4e2bab24f /activesupport/lib/active_support
parent2d898cd8b73dc53d1a2a4652482ba1f8e25a83e9 (diff)
parent7d8e5fac758bebc7199b514b08d4755a6f897435 (diff)
downloadrails-6ba93ac6f6fa873c510a084c6f178390939841e9.tar.gz
rails-6ba93ac6f6fa873c510a084c6f178390939841e9.tar.bz2
rails-6ba93ac6f6fa873c510a084c6f178390939841e9.zip
Merge pull request #6525 from freerange/minitest-passthrough-exceptions
Exceptions like Interrupt & NoMemoryError should not be rescued in tests.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/testing/setup_and_teardown.rb12
1 files changed, 12 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 772c7b4209..527fa555b7 100644
--- a/activesupport/lib/active_support/testing/setup_and_teardown.rb
+++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -4,6 +4,14 @@ require 'active_support/callbacks'
module ActiveSupport
module Testing
module SetupAndTeardown
+
+ PASSTHROUGH_EXCEPTIONS = [
+ NoMemoryError,
+ SignalException,
+ Interrupt,
+ SystemExit
+ ]
+
extend ActiveSupport::Concern
included do
@@ -28,11 +36,15 @@ module ActiveSupport
run_callbacks :setup do
result = super
end
+ rescue *PASSTHROUGH_EXCEPTIONS
+ raise
rescue Exception => e
result = runner.puke(self.class, method_name, e)
ensure
begin
run_callbacks :teardown
+ rescue *PASSTHROUGH_EXCEPTIONS
+ raise
rescue Exception => e
result = runner.puke(self.class, method_name, e)
end