Module: ActiveSupport::Testing::Isolation
- Defined in:
- activesupport/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
60 61 62 |
# File 'activesupport/lib/active_support/testing/isolation.rb', line 60 def self.forking_env? !ENV["NO_FORK"] && ((RbConfig::CONFIG['host_os'] !~ /mswin|mingw/) && (RUBY_PLATFORM !~ /java/)) end |
Instance Method Details
#_run_class_setup ⇒ Object
class setup method should only happen in parent
66 67 68 69 70 71 72 73 |
# File 'activesupport/lib/active_support/testing/isolation.rb', line 66 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 |