From: Wataru Kimura Date: 2010-06-11T03:01:31+09:00 Subject: [ruby-dev:41579] [Backport #2593] WEBrickのContent-RangeがRFCに準拠していない チケット #2593 が更新されました。 (by Wataru Kimura) ファイル patch-test-webrick.diff 追加 ファイル patch-lib-net-http.rb.diff 追加 追加されたテストが次のようにエラーになります。 ruby 1.8.7 (2010-06-10 patchlevel 294) [i686-darwin10.3.0]で確認しました。 ==== 3) Error: test_filehandler(WEBrick::TestFileHandler): NameError: undefined local variable or method `log' for # ./test/webrick/test_filehandler.rb:96:in `test_filehandler' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1054:in `request' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:2144:in `reading_body' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1053:in `request' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1037:in `request' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:543:in `start' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1035:in `request' ./test/webrick/test_filehandler.rb:95:in `test_filehandler' ./test/webrick/utils.rb:38:in `call' ./test/webrick/utils.rb:38:in `start_server' ./test/webrick/utils.rb:46:in `start_httpserver' ./test/webrick/test_filehandler.rb:79:in `test_filehandler' ==== 1.8からもってきたテストコードが不足しているようです。 添付したパッチpatch-test-webrick.diffでテストが実行できるようになります。 また、このパッチを当てるとテストの実行結果は以下のようになります。 ==== 1) Failure: test_filehandler(WEBrick::TestFileHandler) [./test/webrick/test_filehandler.rb:100:in `test_filehandler' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1054:in `request' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:2144:in `reading_body' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1053:in `request' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1037:in `request' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:543:in `start' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1035:in `request' ./test/webrick/test_filehandler.rb:95:in `test_filehandler' ./test/webrick/utils.rb:44:in `call' ./test/webrick/utils.rb:44:in `start_server' ./test/webrick/utils.rb:52:in `start_httpserver' ./test/webrick/test_filehandler.rb:79:in `test_filehandler']: webrick log start: [2010-06-11 02:43:53] INFO WEBrick 1.3.1 [2010-06-11 02:43:53] INFO ruby 1.8.7 (2010-06-10) [i686-darwin10.3.0] [2010-06-11 02:43:53] INFO WEBrick::HTTPServer#start: pid=25412 port=52634 webrick log end. <9285..9384> expected but was <9285..9385>. ==== これは1.8のr27918でのNet::HTTPHeader#content_rangeの修正が 1.8.7に反映されていないためだと思います。 http://redmine.ruby-lang.org/issues/show/2688 添付したパッチpatch-lib-net-http.rb.diffでテストをパスするようになります。 ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2593 ---------------------------------------- http://redmine.ruby-lang.org