diff options
author | Carl Lerche & Yehuda Katz <wycats@gmail.com> | 2009-04-09 12:33:39 -0700 |
---|---|---|
committer | Carl Lerche & Yehuda Katz <wycats@gmail.com> | 2009-04-09 12:33:39 -0700 |
commit | 2036d3ba75da1a0f3061bf5a33c89e2b2eaff420 (patch) | |
tree | feaab4c82bfbc260a5b14b809a44f2caa0b2cb19 /activesupport/lib | |
parent | 1aadafda8dd28ec081da6827878003c478c77c76 (diff) | |
download | rails-2036d3ba75da1a0f3061bf5a33c89e2b2eaff420.tar.gz rails-2036d3ba75da1a0f3061bf5a33c89e2b2eaff420.tar.bz2 rails-2036d3ba75da1a0f3061bf5a33c89e2b2eaff420.zip |
Revert rspec-runner change. TODO: Add back support for the rspec T::U runner.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/testing/setup_and_teardown.rb | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/activesupport/lib/active_support/testing/setup_and_teardown.rb b/activesupport/lib/active_support/testing/setup_and_teardown.rb index 780c1309f4..6248bf1921 100644 --- a/activesupport/lib/active_support/testing/setup_and_teardown.rb +++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb @@ -10,6 +10,8 @@ module ActiveSupport if defined? MiniTest include ForMiniTest + elsif defined? Spec + include ForRspec else include ForClassicTestUnit end @@ -34,19 +36,11 @@ module ActiveSupport result end end - + module ForClassicTestUnit # 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) @@ -60,7 +54,7 @@ module ActiveSupport @_result = result begin begin - # run_callbacks :setup + run_callbacks :setup setup __send__(@method_name) mocha_verify(assertion_counter) if using_mocha @@ -74,7 +68,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 |