aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/isolation.rb
diff options
context:
space:
mode:
authorNick Sieger <nick@nicksieger.com>2010-06-15 15:28:19 -0500
committerwycats <wycats@gmail.com>2010-06-24 09:10:58 -0700
commitb549d93d2f34a18971e691ff93e4c5b7b092eb14 (patch)
tree3a842896273260f3773c3fa92747bbc97a2dc18f /activesupport/lib/active_support/testing/isolation.rb
parent7710a8cb6b0f3b8f94c130aa5d6062d45e34219c (diff)
downloadrails-b549d93d2f34a18971e691ff93e4c5b7b092eb14.tar.gz
rails-b549d93d2f34a18971e691ff93e4c5b7b092eb14.tar.bz2
rails-b549d93d2f34a18971e691ff93e4c5b7b092eb14.zip
AS::Isolation functional on Windows/JRuby.
Doesn't make up for the fact that it's slooooooooow, though. Signed-off-by: wycats <wycats@gmail.com>
Diffstat (limited to 'activesupport/lib/active_support/testing/isolation.rb')
-rw-r--r--activesupport/lib/active_support/testing/isolation.rb19
1 files changed, 11 insertions, 8 deletions
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)