From 579acb49df81c1fadfed15a93236388700744264 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 5 Jan 2012 15:35:38 -0800 Subject: just mix the run method in for minitest --- .../active_support/testing/setup_and_teardown.rb | 25 ++++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'activesupport/lib/active_support') 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 -- cgit v1.2.3