diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-14 04:55:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-14 04:55:13 +0000 |
commit | a6132b37ae2691141d6b9cba47a7e4db35babdd9 (patch) | |
tree | 33b190a456928cd63794478834e05934569e54d2 /test/webrick/test_filehandler.rb | |
parent | 299401542908ecc0d3a6182166198b222b6421d5 (diff) | |
download | ruby-a6132b37ae2691141d6b9cba47a7e4db35babdd9.tar.gz |
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
Diffstat (limited to 'test/webrick/test_filehandler.rb')
-rw-r--r-- | test/webrick/test_filehandler.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb index e120e6dd2a..38b43d75fb 100644 --- a/test/webrick/test_filehandler.rb +++ b/test/webrick/test_filehandler.rb @@ -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" |