Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save shirosaki/3869593 to your computer and use it in GitHub Desktop.
Skip webrick test
Index: test/webrick/test_cgi.rb
===================================================================
--- test/webrick/test_cgi.rb (revision 37136)
+++ test/webrick/test_cgi.rb (working copy)
@@ -37,8 +37,13 @@
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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment