summaryrefslogtreecommitdiff
path: root/test/webrick/test_filehandler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/webrick/test_filehandler.rb')
-rw-r--r--test/webrick/test_filehandler.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb
index fdb2d8a7e2..bcdb3dfed0 100644
--- a/test/webrick/test_filehandler.rb
+++ b/test/webrick/test_filehandler.rb
@@ -217,7 +217,10 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
TestWEBrick.start_httpserver(config) do |server, addr, port, log|
http = Net::HTTP.new(addr, port)
if windows?
- fname = IO.popen("dir /x webrick_long_filename.cgi", "r").read.match(/\s(w.+?cgi)\s/i)[1].downcase
+ fname = nil
+ Dir.chdir(config[:DocumentRoot]) do
+ fname = IO.popen("dir /x webrick_long_filename.cgi", "r").read.match(/\s(w.+?cgi)\s/i)[1].downcase
+ end
else
fname = "webric~1.cgi"
end