Bug #4110
closedホスト名の先頭が数字であるとき、WEBrickのテストでErrorが出る
Description
=begin
ホスト名の先頭が数字であるような環境において、WEBrickのテストでErrorが出ます。
これは、WEBrick::HTTPRequest#parse_uriの中においてURI#host=でホスト名を設定する際、
先頭が数字であるような(ドットを含まない)ホスト名は許されないので例外が発生しているためです。
ひとまず、設定の:ServerNameを'localhost'にしてみたらテストは通りました。
$ ~/local/ruby-trunk/bin/ruby -v test/webrick/test_filehandler.rb
ruby 1.9.3dev (2010-12-02 trunk 30021) [x86_64-linux]
test/webrick/test_filehandler.rb:187: warning: assigned but unused variable - this_file
test/webrick/test_filehandler.rb:202: warning: assigned but unused variable - this_file
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/minitest/unit.rb:623: warning: assigned but unused variable - ac
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/minitest/unit.rb:624: warning: assigned but unused variable - tc
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - canon
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - sw
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - cn
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:446: warning: shadowing outer local variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:13536: warning: assigned but unused variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:447: warning: shadowing outer local variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:13536: warning: assigned but unused variable - s
Run options:
Running tests:¶
..E....
Finished tests in 0.657798s, 10.6416 tests/s, 83.6123 assertions/s.
- Error:
test_make_partial_content(WEBrick::TestFileHandler):
WEBrick::HTTPStatus::BadRequest: bad URI/'. test/webrick/test_filehandler.rb:35:in
make_range_response'
test/webrick/test_filehandler.rb:47:in `test_make_partial_content'
7 tests, 55 assertions, 0 failures, 1 errors, 0 skips
$ ~/local/ruby-trunk/bin/ruby -v test/webrick/test_httprequest.rb
ruby 1.9.3dev (2010-12-02 trunk 30021) [x86_64-linux]
test/webrick/test_httprequest.rb:321: warning: ambiguous first argument; put parentheses or even spaces
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/minitest/unit.rb:623: warning: assigned but unused variable - ac
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/minitest/unit.rb:624: warning: assigned but unused variable - tc
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - canon
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - sw
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - cn
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:446: warning: shadowing outer local variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:14640: warning: assigned but unused variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:447: warning: shadowing outer local variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:14640: warning: assigned but unused variable - s
Run options:
Running tests:¶
..EE.EEE.E....
Finished tests in 0.015776s, 887.4239 tests/s, 3866.6329 assertions/s.
-
Error:
test_continue_not_sent(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI/path'. test/webrick/test_httprequest.rb:332:in
test_continue_not_sent' -
Error:
test_continue_sent(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI/path'. test/webrick/test_httprequest.rb:316:in
test_continue_sent' -
Error:
test_parse_09(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI/'. test/webrick/test_httprequest.rb:12:in
test_parse_09' -
Error:
test_parse_10(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI/'. test/webrick/test_httprequest.rb:29:in
test_parse_10' -
Error:
test_parse_11(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI/path'. test/webrick/test_httprequest.rb:46:in
test_parse_11' -
Error:
test_parse_header2(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI/foo/bar/../baz?q=a'. test/webrick/test_httprequest.rb:117:in
test_parse_header2'
14 tests, 61 assertions, 0 failures, 6 errors, 0 skips
=end
Files