mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_filehandler.rb: fix UNC path failure
* test/webrick/test_filehandler.rb (test_short_filename): pass document root path to cmd.exe instead of chdir there, as cmd.exe does not start on UNC path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1c4fe8df9f
commit
f77967ad73
1 changed files with 6 additions and 3 deletions
|
@ -239,9 +239,12 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
|
|||
TestWEBrick.start_httpserver(config, log_tester) do |server, addr, port, log|
|
||||
http = Net::HTTP.new(addr, port)
|
||||
if windows?
|
||||
fname = nil
|
||||
Dir.chdir(config[:DocumentRoot]) do
|
||||
fname = `dir /x webrick_long_filename.cgi`.match(/\s(w.+?cgi)\s/i)[1].downcase
|
||||
root = config[:DocumentRoot].tr("/", "\\")
|
||||
fname = IO.popen(%W[dir /x #{root}\\webrick_long_filename.cgi], &:read)
|
||||
fname.sub!(/\A.*$^$.*$^$/m, '')
|
||||
if fname
|
||||
fname = fname[/\s(w.+?cgi)\s/i, 1]
|
||||
fname.downcase!
|
||||
end
|
||||
else
|
||||
fname = "webric~1.cgi"
|
||||
|
|
Loading…
Reference in a new issue