123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::Testing::Isolation

Relationships & Source Files
Namespace Children
Modules:
Defined in: activesupport/lib/active_support/testing/isolation.rb

Class Attribute Summary

Instance Method Summary

Class Attribute Details

.forking_env?Boolean (readonly)

[ GitHub ]

  
# File 'activesupport/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

Instance Method Details

#_run_class_setup

class setup method should only happen in parent

[ GitHub ]

  
# File 'activesupport/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

#run

[ GitHub ]

  
# File 'activesupport/lib/active_support/testing/isolation.rb', line 29

def run
  serialized = run_in_isolation do
    super
  end

  Marshal.load(serialized)
end