From b549d93d2f34a18971e691ff93e4c5b7b092eb14 Mon Sep 17 00:00:00 2001 From: Nick Sieger Date: Tue, 15 Jun 2010 15:28:19 -0500 Subject: AS::Isolation functional on Windows/JRuby. Doesn't make up for the fact that it's slooooooooow, though. Signed-off-by: wycats --- activesupport/lib/active_support/testing/isolation.rb | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'activesupport/lib/active_support/testing/isolation.rb') diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb index 69df399cde..d629f6f2b7 100644 --- a/activesupport/lib/active_support/testing/isolation.rb +++ b/activesupport/lib/active_support/testing/isolation.rb @@ -45,12 +45,16 @@ module ActiveSupport end end + def _run_class_setup # class setup method should only happen in parent + unless defined?(@@ran_class_setup) || ENV['ISOLATION_TEST'] + self.class.setup if self.class.respond_to?(:setup) + @@ran_class_setup = true + end + end + module TestUnit def run(result) - unless defined?(@@ran_class_setup) - self.class.setup if self.class.respond_to?(:setup) - @@ran_class_setup = true - end + _run_class_setup yield(Test::Unit::TestCase::STARTED, name) @@ -74,10 +78,7 @@ module ActiveSupport module MiniTest def run(runner) - unless defined?(@@ran_class_setup) - self.class.setup if self.class.respond_to?(:setup) - @@ran_class_setup = true - end + _run_class_setup serialized = run_in_isolation do |isolated_runner| super(isolated_runner) @@ -109,6 +110,8 @@ module ActiveSupport end module Subprocess + ORIG_ARGV = ARGV.dup unless defined?(ORIG_ARGV) + # Crazy H4X to get this working in windows / jruby with # no forking. def run_in_isolation(&blk) -- cgit v1.2.3