Module: ActiveSupport::Testing::Isolation

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

Defined Under Namespace

Modules: Forking, MiniTest, Subprocess, TestUnit

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.forking_env?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/active_support/testing/isolation.rb', line 44

def self.forking_env?
  !ENV["NO_FORK"] && ((RbConfig::CONFIG['host_os'] !~ /mswin|mingw/) && (RUBY_PLATFORM !~ /java/))
end

.included(base) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/active_support/testing/isolation.rb', line 48

def self.included(base)
  if defined?(::MiniTest) && base < ::MiniTest::Unit::TestCase
    base.send :include, MiniTest
  elsif defined?(Test::Unit)
    base.send :include, TestUnit
  end
end

Instance Method Details

#_run_class_setupObject

class setup method should only happen in parent



56
57
58
59
60
61
# File 'lib/active_support/testing/isolation.rb', line 56

def _run_class_setup      # class setup method should only happen in parent
  unless defined?(@@ran_class_setup) || ENV['ISOLATION_TEST']
    self.class.setup if self.class.respond_to?(:setup)
    @@ran_class_setup = true
  end
end