aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/isolation.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-06-28 00:12:15 +0200
committerXavier Noria <fxn@hashref.com>2010-06-28 00:12:15 +0200
commit4329f8133fee8e4f3e558787f67de59f0c4a4dd1 (patch)
tree346ef7340d8348e50d119ca749a16c1654c20a08 /activesupport/lib/active_support/testing/isolation.rb
parentc37f7d66e49ffe5ac2115cc30e5529fd1c2924a8 (diff)
parentebee77a28a7267d5f23a28ba23c1eb88a2d7d527 (diff)
downloadrails-4329f8133fee8e4f3e558787f67de59f0c4a4dd1.tar.gz
rails-4329f8133fee8e4f3e558787f67de59f0c4a4dd1.tar.bz2
rails-4329f8133fee8e4f3e558787f67de59f0c4a4dd1.zip
Merge remote branch 'rails/master'
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)