diff options
author | Matthew Draper <matthew@trebex.net> | 2016-12-01 05:57:18 +1030 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-01 05:57:18 +1030 |
commit | f9592e1631615621d4088498019bf576ac6e85a7 (patch) | |
tree | 7d515c737d040573add869462f1f987fa1e76165 /activesupport | |
parent | 1bdc395d956f789b6612796ac6f130cde90d3066 (diff) | |
parent | 4b3cd4b0fe4d7356567a350535661604d19c110a (diff) | |
download | rails-f9592e1631615621d4088498019bf576ac6e85a7.tar.gz rails-f9592e1631615621d4088498019bf576ac6e85a7.tar.bz2 rails-f9592e1631615621d4088498019bf576ac6e85a7.zip |
Merge pull request #27206 from kirs/fix-testing-isolation-2
Fix arguments passing in testing isolation
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/testing/isolation.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb index 404efe50bf..14edd13a8f 100644 --- a/activesupport/lib/active_support/testing/isolation.rb +++ b/activesupport/lib/active_support/testing/isolation.rb @@ -2,7 +2,6 @@ module ActiveSupport module Testing module Isolation require "thread" - require "shellwords" def self.included(klass) #:nodoc: klass.class_eval do @@ -79,13 +78,15 @@ module ActiveSupport "ISOLATION_OUTPUT" => tmpfile.path } - load_paths = $-I.map { |p| "-I\"#{File.expand_path(p)}\"" }.join(" ") - orig_args = ORIG_ARGV.join(" ") - test_opts = "-n#{self.class.name}##{Shellwords.escape(self.name)}" - command = "#{Gem.ruby} #{load_paths} #{$0} '#{orig_args}' #{test_opts}" + test_opts = "-n#{self.class.name}##{self.name}" - # IO.popen lets us pass env in a cross-platform way - child = IO.popen(env, command) + load_path_args = [] + $-I.each do |p| + load_path_args << "-I" + load_path_args << File.expand_path(p) + end + + child = IO.popen([env, Gem.ruby, *load_path_args, $0, *ORIG_ARGV, test_opts]) begin Process.wait(child.pid) |