diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-10-12 23:03:02 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-10-12 23:03:02 -0500 |
commit | 29b280666b6a8216a46b8349fa76c85f5b5dcc55 (patch) | |
tree | 56ef2169b03356667efd2e48e70e5a23bf819fc9 /activesupport/lib/active_support | |
parent | 4552dabba7e95ca3805747c469858328a4929857 (diff) | |
download | rails-29b280666b6a8216a46b8349fa76c85f5b5dcc55.tar.gz rails-29b280666b6a8216a46b8349fa76c85f5b5dcc55.tar.bz2 rails-29b280666b6a8216a46b8349fa76c85f5b5dcc55.zip |
Get AS TestCase off deprecated callbacks
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/testing/setup_and_teardown.rb | 14 |
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 = '.' |