[前][次][番号順一覧][スレッド一覧]

ruby-changes:37023

From: hsbt <ko1@a...>
Date: Fri, 2 Jan 2015 21:05:02 +0900 (JST)
Subject: [ruby-changes:37023] hsbt:r49104 (trunk): * test/net/http/test_http.rb (_test_send_request__HEAD): Added

hsbt	2015-01-02 21:04:53 +0900 (Fri, 02 Jan 2015)

  New Revision: 49104

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49104

  Log:
    * test/net/http/test_http.rb (_test_send_request__HEAD): Added
      failing test for send_request with HEAD method.

  Modified files:
    trunk/ChangeLog
    trunk/test/net/http/test_http.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49103)
+++ ChangeLog	(revision 49104)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jan  2 21:04:36 2015  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* test/net/http/test_http.rb (_test_send_request__HEAD): Added
+	  failing test for send_request with HEAD method.
+
 Fri Jan  2 18:41:20 2015  Tanaka Akira  <akr@f...>
 
 	* eval.c (ruby_init): Print ruby_setup() error only in debug mode.
Index: test/net/http/test_http.rb
===================================================================
--- test/net/http/test_http.rb	(revision 49103)
+++ test/net/http/test_http.rb	(revision 49104)
@@ -578,6 +578,7 @@ module TestNetHTTP_version_1_2_methods https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L578
   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 https://github.com/ruby/ruby/blob/trunk/test/net/http/test_http.rb#L593
     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')

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]