summaryrefslogtreecommitdiff
path: root/test/webrick
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-08-26 21:41:27 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-30 17:48:15 +0900
commitc75100d00401c32b3245ce8da5b8a045976216ca (patch)
tree6f7d753792c8971922672e99ede844d5b4af879a /test/webrick
parentf7cf5416e471cd34153058952063da3457468e58 (diff)
[ruby/webrick] Allow WEBrick::HTTPServlet::CGIHandler :CGIInterpreter option to be array
This way you don't need to escape each entry. Implements Ruby Feature 15170. https://github.com/ruby/webrick/commit/d8086e600c
Diffstat (limited to 'test/webrick')
-rw-r--r--test/webrick/test_filehandler.rb2
-rw-r--r--test/webrick/utils.rb8
2 files changed, 9 insertions, 1 deletions
diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb
index 4526b1e30a..b3f0de2621 100644
--- a/test/webrick/test_filehandler.rb
+++ b/test/webrick/test_filehandler.rb
@@ -289,7 +289,7 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
return if File.executable?(__FILE__) # skip on strange file system
config = {
- :CGIInterpreter => TestWEBrick::RubyBin,
+ :CGIInterpreter => TestWEBrick::RubyBinArray,
:DocumentRoot => File.dirname(__FILE__),
:CGIPathEnv => ENV['PATH'],
:RequestCallback => Proc.new{|req, res|
diff --git a/test/webrick/utils.rb b/test/webrick/utils.rb
index ca9c56aca2..56d3a30ea4 100644
--- a/test/webrick/utils.rb
+++ b/test/webrick/utils.rb
@@ -19,6 +19,8 @@ module TestWEBrick
Ruby = EnvUtil.rubybin
remove_const :CGIRunner
CGIRunner = "\"#{Ruby}\" \"#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb\"" # :nodoc:
+ remove_const :CGIRunnerArray
+ CGIRunnerArray = [Ruby, "#{WEBrick::Config::LIBDIR}/httpservlet/cgi_runner.rb"] # :nodoc:
end
RubyBin = "\"#{EnvUtil.rubybin}\""
@@ -27,6 +29,12 @@ module TestWEBrick
RubyBin << " \"-I#{File.dirname(EnvUtil.rubybin)}/.ext/common\""
RubyBin << " \"-I#{File.dirname(EnvUtil.rubybin)}/.ext/#{RUBY_PLATFORM}\""
+ RubyBinArray = [EnvUtil.rubybin]
+ RubyBinArray << "--disable-gems"
+ RubyBinArray << "-I" << "#{File.expand_path("../..", File.dirname(__FILE__))}/lib"
+ RubyBinArray << "-I" << "#{File.dirname(EnvUtil.rubybin)}/.ext/common"
+ RubyBinArray << "-I" << "#{File.dirname(EnvUtil.rubybin)}/.ext/#{RUBY_PLATFORM}"
+
require "test/unit" unless defined?(Test::Unit)
include Test::Unit::Assertions
extend Test::Unit::Assertions