Module: ActiveSupport::Testing::Isolation

Defined in:
lib/active_support/testing/isolation.rb

Defined Under Namespace

Modules: Forking, Subprocess

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.forking_env?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/active_support/testing/isolation.rb', line 14

def self.forking_env?
  !ENV["NO_FORK"] && Process.respond_to?(:fork)
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

#runObject



18
19
20
21
22
23
24
# File 'lib/active_support/testing/isolation.rb', line 18

def run
  serialized = run_in_isolation do
    super
  end

  Marshal.load(serialized)
end