aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/testing/after_teardown_test.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-04-27 16:20:16 -0400
committerGitHub <noreply@github.com>2018-04-27 16:20:16 -0400
commitbb2a3afafbcdfac3294479f042cb7a8f7f3d6739 (patch)
tree969200c34176d382da84ba5f13cea0985ecce252 /activesupport/test/testing/after_teardown_test.rb
parentad0220a71a2d42191a3acf6118321b504f1ad70c (diff)
parent1cf8b6c23120e24707a2606a4b159a56faf38212 (diff)
downloadrails-bb2a3afafbcdfac3294479f042cb7a8f7f3d6739.tar.gz
rails-bb2a3afafbcdfac3294479f042cb7a8f7f3d6739.tar.bz2
rails-bb2a3afafbcdfac3294479f042cb7a8f7f3d6739.zip
Merge pull request #32733 from Edouard-chin/ec-setupand-teardown
`SetupAndTeardown` has few caveats that breaks libraries
Diffstat (limited to 'activesupport/test/testing/after_teardown_test.rb')
-rw-r--r--activesupport/test/testing/after_teardown_test.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/activesupport/test/testing/after_teardown_test.rb b/activesupport/test/testing/after_teardown_test.rb
index 68c368909c..961af49479 100644
--- a/activesupport/test/testing/after_teardown_test.rb
+++ b/activesupport/test/testing/after_teardown_test.rb
@@ -4,13 +4,14 @@ require "abstract_unit"
module OtherAfterTeardown
def after_teardown
+ super
+
@witness = true
end
end
-class AfterTeardownTest < Minitest::Test
+class AfterTeardownTest < ActiveSupport::TestCase
include OtherAfterTeardown
- include ActiveSupport::Testing::SetupAndTeardown
attr_writer :witness
@@ -21,11 +22,12 @@ class AfterTeardownTest < Minitest::Test
end
def after_teardown
- assert_raises MyError do
+ assert_changes -> { failures.count }, from: 0, to: 1 do
super
end
assert_equal true, @witness
+ failures.clear
end
def test_teardown_raise_but_all_after_teardown_method_are_called