aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-01-05 15:35:38 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-01-06 14:08:23 -0800
commit579acb49df81c1fadfed15a93236388700744264 (patch)
tree1140a4b0421b767afbc06cd44f255f5ed784a01a
parent0579f303ec0968e66a0e17bc494b06d0996aaffd (diff)
downloadrails-579acb49df81c1fadfed15a93236388700744264.tar.gz
rails-579acb49df81c1fadfed15a93236388700744264.tar.bz2
rails-579acb49df81c1fadfed15a93236388700744264.zip
just mix the run method in for minitest
-rw-r--r--activesupport/lib/active_support/testing/setup_and_teardown.rb25
1 files changed, 11 insertions, 14 deletions
diff --git a/activesupport/lib/active_support/testing/setup_and_teardown.rb b/activesupport/lib/active_support/testing/setup_and_teardown.rb
index 40b781485e..772c7b4209 100644
--- a/activesupport/lib/active_support/testing/setup_and_teardown.rb
+++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -10,7 +10,6 @@ module ActiveSupport
include ActiveSupport::Callbacks
define_callbacks :setup, :teardown
- include ForMiniTest
end
module ClassMethods
@@ -23,24 +22,22 @@ module ActiveSupport
end
end
- module ForMiniTest
- def run(runner)
- result = '.'
+ def run(runner)
+ result = '.'
+ begin
+ run_callbacks :setup do
+ result = super
+ end
+ rescue Exception => e
+ result = runner.puke(self.class, method_name, e)
+ ensure
begin
- run_callbacks :setup do
- result = super
- end
+ run_callbacks :teardown
rescue Exception => e
result = runner.puke(self.class, method_name, e)
- ensure
- begin
- run_callbacks :teardown
- rescue Exception => e
- result = runner.puke(self.class, method_name, e)
- end
end
- result
end
+ result
end
end