mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/net/http/test_http.rb (_test_request__file): specify encoding
explicitly. * test/net/http/utils.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
04d83114a6
commit
7edda76f15
3 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
Mon Jun 30 03:01:35 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* test/net/http/test_http.rb (_test_request__file): specify encoding
|
||||
explicitly.
|
||||
|
||||
* test/net/http/utils.rb: ditto.
|
||||
|
||||
Mon Jun 30 02:31:07 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* encoding.c (rb_utf8_encindex): defined.
|
||||
|
|
|
@ -191,9 +191,9 @@ module TestNetHTTP_version_1_2_methods
|
|||
assert_kind_of Net::HTTPResponse, res
|
||||
assert_not_nil res['content-length']
|
||||
assert_equal $test_net_http_data.size, res['content-length'].to_i
|
||||
f = StringIO.new
|
||||
f = StringIO.new("".force_encoding("ASCII-8BIT"))
|
||||
res.read_body f
|
||||
assert_equal $test_net_http_data.size, f.string.size
|
||||
assert_equal $test_net_http_data.bytesize, f.string.bytesize
|
||||
assert_equal $test_net_http_data.encoding, f.string.encoding
|
||||
assert_equal $test_net_http_data, f.string
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ module TestNetHTTPUtils
|
|||
|
||||
$test_net_http = nil
|
||||
$test_net_http_data = (0...256).to_a.map {|i| i.chr }.join('') * 64
|
||||
$test_net_http_data.force_encoding("ASCII-8BIT")
|
||||
$test_net_http_data_type = 'application/octet-stream'
|
||||
|
||||
class Servlet < WEBrick::HTTPServlet::AbstractServlet
|
||||
|
|
Loading…
Reference in a new issue