diff options
author | deepj <deepjungle.maca@gmail.com> | 2015-01-10 16:37:29 +0100 |
---|---|---|
committer | deepj <deepjungle.maca@gmail.com> | 2015-01-10 16:45:02 +0100 |
commit | 109721c4662ca60a388da34e016436c3798797f1 (patch) | |
tree | 24f9d4d335098675f6212193e00bebc1ccc46224 /activesupport/lib | |
parent | 89470bbc5ea4e1375dc948b0629a419c1ad5c4f5 (diff) | |
download | rails-109721c4662ca60a388da34e016436c3798797f1.tar.gz rails-109721c4662ca60a388da34e016436c3798797f1.tar.bz2 rails-109721c4662ca60a388da34e016436c3798797f1.zip |
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
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/testing/isolation.rb | 4 |
1 files changed, 1 insertions, 3 deletions
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 |