diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb index 99bc1420b8..5d68749c22 100644 --- a/test/webrick/test_filehandler.rb +++ b/test/webrick/test_filehandler.rb @@ -114,7 +114,7 @@ def test_filehandler http.request(req){|res| assert_equal("200", res.code, log.call) assert_equal("text/plain", res.content_type, log.call) - assert_equal(File.read(__FILE__), res.body, log.call) + assert_equal(File.read(__FILE__), res.body.gsub(/\r/, ''), log.call) } req = Net::HTTP::Get.new("/#{this_file}", "range"=>"bytes=#{filesize-100}-") diff --git a/test/webrick/test_httprequest.rb b/test/webrick/test_httprequest.rb index 678efed1ca..016a8a418b 100644 --- a/test/webrick/test_httprequest.rb +++ b/test/webrick/test_httprequest.rb @@ -254,14 +254,14 @@ def test_chunked msg << "0" << crlf req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP) req.parse(StringIO.new(msg)) - assert_equal(expect, req.body) + assert_equal(expect, req.body.gsub(/\r/, '')) # chunked req.body_reader req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP) req.parse(StringIO.new(msg)) dst = StringIO.new IO.copy_stream(req.body_reader, dst) - assert_equal(expect, dst.string) + assert_equal(expect, dst.string.gsub(/\r/, '')) end def test_forwarded