From ccf911a02d35bf1d1667149d94b16da429049eee Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 10 Aug 2012 10:53:18 +0000 Subject: Refix r36678: switch with zlib and check content-encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/net/http/test_httpresponse.rb | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'test/net/http') diff --git a/test/net/http/test_httpresponse.rb b/test/net/http/test_httpresponse.rb index c201410598..70313cc519 100644 --- a/test/net/http/test_httpresponse.rb +++ b/test/net/http/test_httpresponse.rb @@ -92,8 +92,14 @@ EOS body = res.read_body end - assert_equal 'hello', body - end if Net::HTTP::HAVE_ZLIB + if Net::HTTP::HAVE_ZLIB + assert_equal nil, res['content-encoding'] + assert_equal 'hello', body + else + assert_equal 'deflate', res['content-encoding'] + assert_equal "x\x9C\xCBH\xCD\xC9\xC9\a\x00\x06,\x02\x15", body + end + end def test_read_body_content_encoding_deflate_chunked io = dummy_io(<