Module: ActiveSupport::Testing::Isolation
- Defined in:
- lib/active_support/testing/isolation.rb
Defined Under Namespace
Modules: Forking, Subprocess
Constant Summary collapse
- @@class_setup_mutex =
Mutex.new
Class Method Summary collapse
Instance Method Summary collapse
-
#_run_class_setup ⇒ Object
class setup method should only happen in parent.
- #run ⇒ Object
Class Method Details
.forking_env? ⇒ Boolean
14 15 16 |
# File 'lib/active_support/testing/isolation.rb', line 14 def self.forking_env? !ENV["NO_FORK"] && ((RbConfig::CONFIG['host_os'] !~ /mswin|mingw/) && (RUBY_PLATFORM !~ /java/)) end |
.included(klass) ⇒ Object
:nodoc:
8 9 10 11 12 |
# File 'lib/active_support/testing/isolation.rb', line 8 def self.included(klass) #:nodoc: klass.class_eval do parallelize_me! end end |
Instance Method Details
#_run_class_setup ⇒ Object
class setup method should only happen in parent
20 21 22 23 24 25 26 27 |
# File 'lib/active_support/testing/isolation.rb', line 20 def _run_class_setup # class setup method should only happen in parent @@class_setup_mutex.synchronize do unless defined?(@@ran_class_setup) || ENV['ISOLATION_TEST'] self.class.setup if self.class.respond_to?(:setup) @@ran_class_setup = true end end end |