diff options
author | Yehuda Katz and Carl Lerche <wycats@gmail.com> | 2009-04-06 12:35:24 -0700 |
---|---|---|
committer | Yehuda Katz and Carl Lerche <wycats@gmail.com> | 2009-04-06 12:35:24 -0700 |
commit | 4d3cd9b43f6b7425ca3eee303773d2221e8af38f (patch) | |
tree | bcec21b06b1940617eaf9f8682523cd6526ba47c /activesupport/lib/active_support/testing | |
parent | a501638e9dcf55e45613637c52e4169b6324f285 (diff) | |
download | rails-4d3cd9b43f6b7425ca3eee303773d2221e8af38f.tar.gz rails-4d3cd9b43f6b7425ca3eee303773d2221e8af38f.tar.bz2 rails-4d3cd9b43f6b7425ca3eee303773d2221e8af38f.zip |
Changes necessary to run the T::U tests with the rspec runner
Diffstat (limited to 'activesupport/lib/active_support/testing')
-rw-r--r-- | activesupport/lib/active_support/testing/setup_and_teardown.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/testing/setup_and_teardown.rb b/activesupport/lib/active_support/testing/setup_and_teardown.rb index 245f57a7b0..780c1309f4 100644 --- a/activesupport/lib/active_support/testing/setup_and_teardown.rb +++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb @@ -39,6 +39,14 @@ module ActiveSupport # For compatibility with Ruby < 1.8.6 PASSTHROUGH_EXCEPTIONS = Test::Unit::TestCase::PASSTHROUGH_EXCEPTIONS rescue [NoMemoryError, SignalException, Interrupt, SystemExit] + def setup + run_callbacks :setup + end + + def teardown + run_callbacks :teardown, :enumerator => :reverse_each + end + # This redefinition is unfortunate but test/unit shows us no alternative. # Doubly unfortunate: hax to support Mocha's hax. def run(result) @@ -52,7 +60,7 @@ module ActiveSupport @_result = result begin begin - run_callbacks :setup + # run_callbacks :setup setup __send__(@method_name) mocha_verify(assertion_counter) if using_mocha @@ -66,7 +74,7 @@ module ActiveSupport ensure begin teardown - run_callbacks :teardown, :enumerator => :reverse_each + # run_callbacks :teardown, :enumerator => :reverse_each rescue Test::Unit::AssertionFailedError => e add_failure(e.message, e.backtrace) rescue Exception => e |