aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/setup_and_teardown.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-04-06 13:10:08 -0400
committerGitHub <noreply@github.com>2018-04-06 13:10:08 -0400
commit00f2dbd09b676f0efb38f4d1dc2d9f047d838309 (patch)
tree98487d42cc5e0e312652498a44bcff17c5d2c191 /activesupport/lib/active_support/testing/setup_and_teardown.rb
parentbe811c33956407e675f94df2859fc2ef0cce8ddb (diff)
parent01eddb390c4016f7af61979519911ed442aa7a06 (diff)
downloadrails-00f2dbd09b676f0efb38f4d1dc2d9f047d838309.tar.gz
rails-00f2dbd09b676f0efb38f4d1dc2d9f047d838309.tar.bz2
rails-00f2dbd09b676f0efb38f4d1dc2d9f047d838309.zip
Merge pull request #32472 from Edouard-chin/ec-activesupport-teardown
`SetupAndTeardown#teardown` should call any subsequent after_teardown:
Diffstat (limited to 'activesupport/lib/active_support/testing/setup_and_teardown.rb')
-rw-r--r--activesupport/lib/active_support/testing/setup_and_teardown.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/testing/setup_and_teardown.rb b/activesupport/lib/active_support/testing/setup_and_teardown.rb
index 1dbf3c5da0..35236f1401 100644
--- a/activesupport/lib/active_support/testing/setup_and_teardown.rb
+++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -44,8 +44,15 @@ module ActiveSupport
end
def after_teardown # :nodoc:
- run_callbacks :teardown
+ begin
+ run_callbacks :teardown
+ rescue => e
+ error = e
+ end
+
super
+ ensure
+ raise error if error
end
end
end