summaryrefslogtreecommitdiff
path: root/test/webrick/test_filehandler.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-05 10:36:24 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-05 10:36:24 +0000
commit0f5853c2c4fd35bbd42e503004195f8c18477c8d (patch)
tree535c5f6015a042f333babdeb567f4276e38c401a /test/webrick/test_filehandler.rb
parent5a9b23abb748e3a11992b77aa2304cb72e9814c6 (diff)
Use binread because webrick also uses binread
Reported-by: MSP-Greg [Bug #15203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick/test_filehandler.rb')
-rw-r--r--test/webrick/test_filehandler.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb
index 99bc1420b8..7095038189 100644
--- a/test/webrick/test_filehandler.rb
+++ b/test/webrick/test_filehandler.rb
@@ -98,7 +98,7 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
config = { :DocumentRoot => File.dirname(__FILE__), }
this_file = File.basename(__FILE__)
filesize = File.size(__FILE__)
- this_data = File.open(__FILE__, "rb") {|f| f.read}
+ this_data = File.binread(__FILE__)
range = nil
bug2593 = '[ruby-dev:40030]'
@@ -114,7 +114,7 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase
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(this_data, res.body, log.call)
}
req = Net::HTTP::Get.new("/#{this_file}", "range"=>"bytes=#{filesize-100}-")