Module: Tapioca::Helpers::Test::Isolation

Extended by:
T::Sig
Includes:
Forking, Subprocess
Included in:
DslCompiler
Defined in:
lib/tapioca/helpers/test/isolation.rb

Overview

Copied from ActiveSupport::Testing::Isolation since we cannot require constants from ActiveSupport without polluting the global namespace.

Defined Under Namespace

Modules: Forking, Subprocess

Constant Summary

Constants included from Subprocess

Subprocess::ORIG_ARGV

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Subprocess

#run_in_isolation

Methods included from Forking

#run_in_isolation

Class Method Details

.forking_env?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/tapioca/helpers/test/isolation.rb', line 17

def forking_env?
  !ENV["NO_FORK"] && Process.respond_to?(:fork)
end

Instance Method Details

#runObject



22
23
24
25
26
27
28
# File 'lib/tapioca/helpers/test/isolation.rb', line 22

def run
  serialized = T.unsafe(self).run_in_isolation do
    super
  end

  Marshal.load(serialized)
end