aboutsummaryrefslogtreecommitdiffstats
path: root/test/net
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-02 12:04:53 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-02 12:04:53 +0000
commit57ee6eae5a133952b5f7ce8abe5d8b99e60fd7a8 (patch)
tree5fa0880c0eea399737292f2875539ab11169a34d /test/net
parentd4959439abf1aec694ca5ad836e451892919af4a (diff)
downloadruby-57ee6eae5a133952b5f7ce8abe5d8b99e60fd7a8.tar.gz
* test/net/http/test_http.rb (_test_send_request__HEAD): Added
failing test for send_request with HEAD method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r--test/net/http/test_http.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index 2cd883da79..9d5cf3972b 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -578,6 +578,7 @@ module TestNetHTTP_version_1_2_methods
def test_send_request
start {|http|
_test_send_request__GET http
+ _test_send_request__HEAD http
_test_send_request__POST http
}
end
@@ -592,6 +593,16 @@ module TestNetHTTP_version_1_2_methods
assert_equal $test_net_http_data, res.body
end
+ def _test_send_request__HEAD(http)
+ res = http.send_request('HEAD', '/')
+ assert_kind_of Net::HTTPResponse, res
+ unless self.is_a?(TestNetHTTP_v1_2_chunked)
+ assert_not_nil res['content-length']
+ assert_equal $test_net_http_data.size, res['content-length'].to_i
+ end
+ assert_nil res.body
+ end
+
def _test_send_request__POST(http)
data = 'aaabbb cc ddddddddddd lkjoiu4j3qlkuoa'
res = http.send_request('POST', '/', data, 'content-type' => 'application/x-www-form-urlencoded')