From 109721c4662ca60a388da34e016436c3798797f1 Mon Sep 17 00:00:00 2001 From: deepj Date: Sat, 10 Jan 2015 16:37:29 +0100 Subject: Better fork detection in ActiveSupport::Testing::Isolation Process.respond_to?(:fork) returns false if fork is not available. More on http://www.ruby-doc.org/core-2.0.0/Process.html#method-c-fork --- activesupport/lib/active_support/testing/isolation.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb index 68bda35980..247df7423b 100644 --- a/activesupport/lib/active_support/testing/isolation.rb +++ b/activesupport/lib/active_support/testing/isolation.rb @@ -1,5 +1,3 @@ -require 'rbconfig' - module ActiveSupport module Testing module Isolation @@ -12,7 +10,7 @@ module ActiveSupport end def self.forking_env? - !ENV["NO_FORK"] && ((RbConfig::CONFIG['host_os'] !~ /mswin|mingw/) && (RUBY_PLATFORM !~ /java/)) + !ENV["NO_FORK"] && Process.respond_to?(:fork) end @@class_setup_mutex = Mutex.new -- cgit v1.2.3