diff options
| author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-29 18:02:24 +0000 |
|---|---|---|
| committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-29 18:02:24 +0000 |
| commit | bdd9c5747f9e0a354db25bc4905cf2ca11bff155 (patch) | |
| tree | 85553c61ed2beedf22765e3ad5b6848b4b4b227f /test/net | |
| parent | d16da4863c91be2d6ccc5e60938427d676714ee9 (diff) | |
| download | ruby-bdd9c5747f9e0a354db25bc4905cf2ca11bff155.tar.gz ruby-bdd9c5747f9e0a354db25bc4905cf2ca11bff155.tar.xz ruby-bdd9c5747f9e0a354db25bc4905cf2ca11bff155.zip | |
* test/net/http/test_http.rb (_test_request__file): specify encoding
explicitly.
* test/net/http/utils.rb: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
| -rw-r--r-- | test/net/http/test_http.rb | 4 | ||||
| -rw-r--r-- | test/net/http/utils.rb | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index 8b23edf61..50d1fe2ea 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -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 } diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb index 766bf71c4..e685a8ff6 100644 --- a/test/net/http/utils.rb +++ b/test/net/http/utils.rb @@ -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 |
