aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/setup_and_teardown.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/testing/setup_and_teardown.rb')
-rw-r--r--activesupport/lib/active_support/testing/setup_and_teardown.rb14
1 files changed, 13 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 7952eb50c3..97773dc2c0 100644
--- a/activesupport/lib/active_support/testing/setup_and_teardown.rb
+++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -3,7 +3,9 @@ module ActiveSupport
module SetupAndTeardown
def self.included(base)
base.class_eval do
- include ActiveSupport::DeprecatedCallbacks
+ extend ClassMethods
+
+ include ActiveSupport::Callbacks
define_callbacks :setup, :teardown
if defined?(MiniTest::Assertions) && TestCase < MiniTest::Assertions
@@ -14,6 +16,16 @@ module ActiveSupport
end
end
+ module ClassMethods
+ def setup(*args, &block)
+ set_callback(:setup, *args, &block)
+ end
+
+ def teardown(*args, &block)
+ set_callback(:teardown, *args, &block)
+ end
+ end
+
module ForMiniTest
def run(runner)
result = '.'