summaryrefslogtreecommitdiff
path: root/test/webrick
diff options
context:
space:
mode:
authorshirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-12 13:30:11 +0000
committershirosaki <shirosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-12 13:30:11 +0000
commit25a79e9f9be11f184485d3177a7ec75516d37259 (patch)
treeaa525393ec6b463542d5e26265c6f95dcb790228 /test/webrick
parent7206f9bc7913fc191fddd654ea9cbded9abad14f (diff)
test_cgi.rb: skip a test on Windows
* test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): skip a test depending on locale on Windows. ENV[] doesn't work properly if console code page is not equal to file system encoding. [ruby-core:47910] [Bug #7140] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick')
-rw-r--r--test/webrick/test_cgi.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/webrick/test_cgi.rb b/test/webrick/test_cgi.rb
index d930c26..72e3be9 100644
--- a/test/webrick/test_cgi.rb
+++ b/test/webrick/test_cgi.rb
@@ -37,8 +37,13 @@ class TestWEBrickCGI < Test::Unit::TestCase
req = Net::HTTP::Get.new("/webrick.cgi/%3F%3F%3F?foo=bar")
http.request(req){|res| assert_equal("/???", res.body, log.call)}
req = Net::HTTP::Get.new("/webrick.cgi/%A4%DB%A4%B2/%A4%DB%A4%B2")
- http.request(req){|res|
- assert_equal("/\xA4\xDB\xA4\xB2/\xA4\xDB\xA4\xB2", res.body, log.call)}
+ # Path info of res.body is passed via ENV.
+ # ENV[] returns different value on Windows depending on locale.
+ unless RUBY_PLATFORM =~ /mswin32|mingw|cygwin|bccwin32/ &&
+ Encoding.find("locale") != Encoding.find("filesystem")
+ http.request(req){|res|
+ assert_equal("/\xA4\xDB\xA4\xB2/\xA4\xDB\xA4\xB2", res.body, log.call)}
+ end
req = Net::HTTP::Get.new("/webrick.cgi?a=1;a=2;b=x")
http.request(req){|res| assert_equal("a=1, a=2, b=x", res.body, log.call)}
req = Net::HTTP::Get.new("/webrick.cgi?a=1&a=2&b=x")