From 29b280666b6a8216a46b8349fa76c85f5b5dcc55 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 12 Oct 2009 23:03:02 -0500 Subject: Get AS TestCase off deprecated callbacks --- .../lib/active_support/testing/setup_and_teardown.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/testing/setup_and_teardown.rb') 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 = '.' -- cgit v1.2.3