From 1d280e21a19aff74e1b35779be2633e6efa511f0 Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Thu, 2 Jul 2009 16:03:41 -0700 Subject: Adds support for def self.setup in isolation tests for setup that should be run only once in the parent --- activesupport/lib/active_support/testing/isolation.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb index 090e0c5c89..dd13abcd5d 100644 --- a/activesupport/lib/active_support/testing/isolation.rb +++ b/activesupport/lib/active_support/testing/isolation.rb @@ -21,6 +21,11 @@ module ActiveSupport::Testing end def run(result) + unless defined?(@@ran_class_setup) + self.class.setup + @@ran_class_setup = true + end + yield(Test::Unit::TestCase::STARTED, name) @_result = result -- cgit v1.2.3