From 01eddb390c4016f7af61979519911ed442aa7a06 Mon Sep 17 00:00:00 2001 From: Edouard CHIN Date: Fri, 6 Apr 2018 12:17:58 -0400 Subject: Rename the class as there is already an existing class with that name --- activesupport/test/testing/after_teardown_test.rb | 34 ++++++++++++++++++++++ .../test/testing/setup_and_teardown_test.rb | 34 ---------------------- 2 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 activesupport/test/testing/after_teardown_test.rb delete mode 100644 activesupport/test/testing/setup_and_teardown_test.rb (limited to 'activesupport/test/testing') diff --git a/activesupport/test/testing/after_teardown_test.rb b/activesupport/test/testing/after_teardown_test.rb new file mode 100644 index 0000000000..68c368909c --- /dev/null +++ b/activesupport/test/testing/after_teardown_test.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require "abstract_unit" + +module OtherAfterTeardown + def after_teardown + @witness = true + end +end + +class AfterTeardownTest < Minitest::Test + include OtherAfterTeardown + include ActiveSupport::Testing::SetupAndTeardown + + attr_writer :witness + + MyError = Class.new(StandardError) + + teardown do + raise MyError, "Test raises an error, all after_teardown should still get called" + end + + def after_teardown + assert_raises MyError do + super + end + + assert_equal true, @witness + end + + def test_teardown_raise_but_all_after_teardown_method_are_called + assert true + end +end diff --git a/activesupport/test/testing/setup_and_teardown_test.rb b/activesupport/test/testing/setup_and_teardown_test.rb deleted file mode 100644 index 283f82d19a..0000000000 --- a/activesupport/test/testing/setup_and_teardown_test.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -require "abstract_unit" - -module OtherAfterTeardown - def after_teardown - @witness = true - end -end - -class SetupAndTeardownTest < Minitest::Test - include OtherAfterTeardown - include ActiveSupport::Testing::SetupAndTeardown - - attr_writer :witness - - MyError = Class.new(StandardError) - - teardown do - raise MyError, "Test raises an error, all after_teardown should still get called" - end - - def after_teardown - assert_raises MyError do - super - end - - assert_equal true, @witness - end - - def test_teardown_raise_but_all_after_teardown_method_are_called - assert true - end -end -- cgit v1.2.3