Skip to content

Commit 2036d3b

Browse files
committed
Revert rspec-runner change. TODO: Add back support for the rspec T::U runner.
1 parent 1aadafd commit 2036d3b

File tree

2 files changed

+306
-310
lines changed

2 files changed

+306
-310
lines changed

activesupport/lib/active_support/testing/setup_and_teardown.rb

+5-11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def self.included(base)
1010

1111
if defined? MiniTest
1212
include ForMiniTest
13+
elsif defined? Spec
14+
include ForRspec
1315
else
1416
include ForClassicTestUnit
1517
end
@@ -34,19 +36,11 @@ def run(runner)
3436
result
3537
end
3638
end
37-
39+
3840
module ForClassicTestUnit
3941
# For compatibility with Ruby < 1.8.6
4042
PASSTHROUGH_EXCEPTIONS = Test::Unit::TestCase::PASSTHROUGH_EXCEPTIONS rescue [NoMemoryError, SignalException, Interrupt, SystemExit]
4143

42-
def setup
43-
run_callbacks :setup
44-
end
45-
46-
def teardown
47-
run_callbacks :teardown, :enumerator => :reverse_each
48-
end
49-
5044
# This redefinition is unfortunate but test/unit shows us no alternative.
5145
# Doubly unfortunate: hax to support Mocha's hax.
5246
def run(result)
@@ -60,7 +54,7 @@ def run(result)
6054
@_result = result
6155
begin
6256
begin
63-
# run_callbacks :setup
57+
run_callbacks :setup
6458
setup
6559
__send__(@method_name)
6660
mocha_verify(assertion_counter) if using_mocha
@@ -74,7 +68,7 @@ def run(result)
7468
ensure
7569
begin
7670
teardown
77-
# run_callbacks :teardown, :enumerator => :reverse_each
71+
run_callbacks :teardown, :enumerator => :reverse_each
7872
rescue Test::Unit::AssertionFailedError => e
7973
add_failure(e.message, e.backtrace)
8074
rescue Exception => e

0 commit comments

Comments
 (0)