summaryrefslogtreecommitdiff
path: root/test/webrick/test_cgi.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/webrick/test_cgi.rb')
-rw-r--r--test/webrick/test_cgi.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/webrick/test_cgi.rb b/test/webrick/test_cgi.rb
index 60d5da6a72..082fe0f190 100644
--- a/test/webrick/test_cgi.rb
+++ b/test/webrick/test_cgi.rb
@@ -16,6 +16,7 @@ class TestWEBrickCGI < Test::Unit::TestCase
config = {
:CGIInterpreter => EnvUtil.rubybin,
:DocumentRoot => File.dirname(__FILE__),
+ :DirectoryIndex => ["webrick.cgi"],
}
TestWEBrick.start_httpserver(config){|server, addr, port|
http = Net::HTTP.new(addr, port)
@@ -41,6 +42,12 @@ class TestWEBrickCGI < Test::Unit::TestCase
req["Content-Type"] = "application/x-www-form-urlencoded"
http.request(req, "a=1&a=2&b=x"){|res|
assert_equal("a=1, a=2, b=x", res.body)}
+ req = Net::HTTP::Get.new("/")
+ http.request(req){|res|
+ ary = res.body.to_a
+ assert_match(%r{/$}, ary[0])
+ assert_match(%r{/webrick.cgi$}, ary[1])
+ }
}
end
end