diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-08-26 21:41:27 -0700 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-11-30 17:48:15 +0900 |
commit | c75100d00401c32b3245ce8da5b8a045976216ca (patch) | |
tree | 6f7d753792c8971922672e99ede844d5b4af879a /test | |
parent | f7cf5416e471cd34153058952063da3457468e58 (diff) | |
download | ruby-c75100d00401c32b3245ce8da5b8a045976216ca.tar.gz |
[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')
-rw-r--r-- | test/webrick/test_filehandler.rb | 2 | ||||
-rw-r--r-- | test/webrick/utils.rb | 8 |
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 |