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)


14
15
16
# File 'lib/tapioca/helpers/test/isolation.rb', line 14

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

Instance Method Details

#runObject



18
19
20
21
22
23
24
# File 'lib/tapioca/helpers/test/isolation.rb', line 18

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

  Marshal.load(serialized)
end