rubysl-net-http 0.0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +0 -1
  3. data/.travis.yml +7 -0
  4. data/README.md +2 -2
  5. data/Rakefile +0 -1
  6. data/lib/net/http.rb +1 -0
  7. data/lib/rubysl/net/http.rb +2 -0
  8. data/lib/rubysl/net/http/http.rb +2290 -0
  9. data/lib/rubysl/net/http/https.rb +173 -0
  10. data/lib/{rubysl-net-http → rubysl/net/http}/version.rb +2 -2
  11. data/rubysl-net-http.gemspec +18 -18
  12. data/spec/HTTPBadResponse_spec.rb +7 -0
  13. data/spec/HTTPError_spec.rb +11 -0
  14. data/spec/HTTPFatalError_spec.rb +11 -0
  15. data/spec/HTTPHeaderSyntaxError_spec.rb +7 -0
  16. data/spec/HTTPRetriableError_spec.rb +11 -0
  17. data/spec/HTTPServerException_spec.rb +11 -0
  18. data/spec/http/Proxy_spec.rb +34 -0
  19. data/spec/http/active_spec.rb +7 -0
  20. data/spec/http/address_spec.rb +8 -0
  21. data/spec/http/close_on_empty_response_spec.rb +9 -0
  22. data/spec/http/copy_spec.rb +26 -0
  23. data/spec/http/default_port_spec.rb +7 -0
  24. data/spec/http/delete_spec.rb +26 -0
  25. data/spec/http/finish_spec.rb +30 -0
  26. data/spec/http/fixtures/http_server.rb +97 -0
  27. data/spec/http/get2_spec.rb +7 -0
  28. data/spec/http/get_print_spec.rb +28 -0
  29. data/spec/http/get_response_spec.rb +28 -0
  30. data/spec/http/get_spec.rb +52 -0
  31. data/spec/http/head2_spec.rb +8 -0
  32. data/spec/http/head_spec.rb +30 -0
  33. data/spec/http/http_default_port_spec.rb +7 -0
  34. data/spec/http/https_default_port_spec.rb +7 -0
  35. data/spec/http/initialize_spec.rb +45 -0
  36. data/spec/http/inspect_spec.rb +25 -0
  37. data/spec/http/is_version_1_1_spec.rb +6 -0
  38. data/spec/http/is_version_1_2_spec.rb +6 -0
  39. data/spec/http/lock_spec.rb +26 -0
  40. data/spec/http/mkcol_spec.rb +26 -0
  41. data/spec/http/move_spec.rb +30 -0
  42. data/spec/http/new_spec.rb +96 -0
  43. data/spec/http/newobj_spec.rb +47 -0
  44. data/spec/http/open_timeout_spec.rb +23 -0
  45. data/spec/http/options_spec.rb +30 -0
  46. data/spec/http/port_spec.rb +8 -0
  47. data/spec/http/post2_spec.rb +7 -0
  48. data/spec/http/post_form_spec.rb +20 -0
  49. data/spec/http/post_spec.rb +43 -0
  50. data/spec/http/propfind_spec.rb +29 -0
  51. data/spec/http/proppatch_spec.rb +29 -0
  52. data/spec/http/proxy_address_spec.rb +30 -0
  53. data/spec/http/proxy_class_spec.rb +8 -0
  54. data/spec/http/proxy_pass_spec.rb +38 -0
  55. data/spec/http/proxy_port_spec.rb +38 -0
  56. data/spec/http/proxy_user_spec.rb +38 -0
  57. data/spec/http/put2_spec.rb +7 -0
  58. data/spec/http/put_spec.rb +29 -0
  59. data/spec/http/read_timeout_spec.rb +23 -0
  60. data/spec/http/request_get_spec.rb +7 -0
  61. data/spec/http/request_head_spec.rb +7 -0
  62. data/spec/http/request_post_spec.rb +7 -0
  63. data/spec/http/request_put_spec.rb +7 -0
  64. data/spec/http/request_spec.rb +114 -0
  65. data/spec/http/request_types_spec.rb +253 -0
  66. data/spec/http/send_request_spec.rb +123 -0
  67. data/spec/http/set_debug_output_spec.rb +34 -0
  68. data/spec/http/shared/request_get.rb +49 -0
  69. data/spec/http/shared/request_head.rb +49 -0
  70. data/spec/http/shared/request_post.rb +49 -0
  71. data/spec/http/shared/request_put.rb +49 -0
  72. data/spec/http/shared/started.rb +28 -0
  73. data/spec/http/shared/version_1_1.rb +19 -0
  74. data/spec/http/shared/version_1_2.rb +6 -0
  75. data/spec/http/socket_type_spec.rb +7 -0
  76. data/spec/http/start_spec.rb +115 -0
  77. data/spec/http/started_spec.rb +7 -0
  78. data/spec/http/trace_spec.rb +29 -0
  79. data/spec/http/unlock_spec.rb +29 -0
  80. data/spec/http/use_ssl_spec.rb +8 -0
  81. data/spec/http/version_1_1_spec.rb +21 -0
  82. data/spec/http/version_1_2_spec.rb +19 -0
  83. data/spec/httpexceptions/fixtures/classes.rb +5 -0
  84. data/spec/httpexceptions/initialize_spec.rb +16 -0
  85. data/spec/httpexceptions/response_spec.rb +9 -0
  86. data/spec/httpgenericrequest/body_exist_spec.rb +26 -0
  87. data/spec/httpgenericrequest/body_spec.rb +29 -0
  88. data/spec/httpgenericrequest/body_stream_spec.rb +31 -0
  89. data/spec/httpgenericrequest/exec_spec.rb +135 -0
  90. data/spec/httpgenericrequest/inspect_spec.rb +24 -0
  91. data/spec/httpgenericrequest/method_spec.rb +14 -0
  92. data/spec/httpgenericrequest/path_spec.rb +11 -0
  93. data/spec/httpgenericrequest/request_body_permitted_spec.rb +11 -0
  94. data/spec/httpgenericrequest/response_body_permitted_spec.rb +11 -0
  95. data/spec/httpgenericrequest/set_body_internal_spec.rb +20 -0
  96. data/spec/httpheader/add_field_spec.rb +30 -0
  97. data/spec/httpheader/basic_auth_spec.rb +13 -0
  98. data/spec/httpheader/canonical_each_spec.rb +7 -0
  99. data/spec/httpheader/chunked_spec.rb +21 -0
  100. data/spec/httpheader/content_length_spec.rb +53 -0
  101. data/spec/httpheader/content_range_spec.rb +33 -0
  102. data/spec/httpheader/content_type_spec.rb +25 -0
  103. data/spec/httpheader/delete_spec.rb +29 -0
  104. data/spec/httpheader/each_capitalized_name_spec.rb +44 -0
  105. data/spec/httpheader/each_capitalized_spec.rb +8 -0
  106. data/spec/httpheader/each_header_spec.rb +7 -0
  107. data/spec/httpheader/each_key_spec.rb +7 -0
  108. data/spec/httpheader/each_name_spec.rb +7 -0
  109. data/spec/httpheader/each_spec.rb +7 -0
  110. data/spec/httpheader/each_value_spec.rb +45 -0
  111. data/spec/httpheader/element_reference_spec.rb +38 -0
  112. data/spec/httpheader/element_set_spec.rb +40 -0
  113. data/spec/httpheader/fetch_spec.rb +68 -0
  114. data/spec/httpheader/fixtures/classes.rb +11 -0
  115. data/spec/httpheader/form_data_spec.rb +7 -0
  116. data/spec/httpheader/get_fields_spec.rb +38 -0
  117. data/spec/httpheader/initialize_http_header_spec.rb +28 -0
  118. data/spec/httpheader/key_spec.rb +20 -0
  119. data/spec/httpheader/length_spec.rb +7 -0
  120. data/spec/httpheader/main_type_spec.rb +23 -0
  121. data/spec/httpheader/proxy_basic_auth_spec.rb +13 -0
  122. data/spec/httpheader/range_length_spec.rb +31 -0
  123. data/spec/httpheader/range_spec.rb +47 -0
  124. data/spec/httpheader/set_content_type_spec.rb +7 -0
  125. data/spec/httpheader/set_form_data_spec.rb +7 -0
  126. data/spec/httpheader/set_range_spec.rb +7 -0
  127. data/spec/httpheader/shared/each_capitalized.rb +42 -0
  128. data/spec/httpheader/shared/each_header.rb +42 -0
  129. data/spec/httpheader/shared/each_name.rb +39 -0
  130. data/spec/httpheader/shared/set_content_type.rb +20 -0
  131. data/spec/httpheader/shared/set_form_data.rb +27 -0
  132. data/spec/httpheader/shared/set_range.rb +89 -0
  133. data/spec/httpheader/shared/size.rb +18 -0
  134. data/spec/httpheader/size_spec.rb +7 -0
  135. data/spec/httpheader/sub_type_spec.rb +31 -0
  136. data/spec/httpheader/to_hash_spec.rb +24 -0
  137. data/spec/httpheader/type_params_spec.rb +23 -0
  138. data/spec/httprequest/initialize_spec.rb +44 -0
  139. data/spec/httpresponse/body_permitted_spec.rb +12 -0
  140. data/spec/httpresponse/body_spec.rb +6 -0
  141. data/spec/httpresponse/code_spec.rb +23 -0
  142. data/spec/httpresponse/code_type_spec.rb +23 -0
  143. data/spec/httpresponse/entity_spec.rb +6 -0
  144. data/spec/httpresponse/error_spec.rb +23 -0
  145. data/spec/httpresponse/error_type_spec.rb +23 -0
  146. data/spec/httpresponse/exception_type_spec.rb +12 -0
  147. data/spec/httpresponse/header_spec.rb +8 -0
  148. data/spec/httpresponse/http_version_spec.rb +11 -0
  149. data/spec/httpresponse/initialize_spec.rb +10 -0
  150. data/spec/httpresponse/inspect_spec.rb +14 -0
  151. data/spec/httpresponse/message_spec.rb +8 -0
  152. data/spec/httpresponse/msg_spec.rb +8 -0
  153. data/spec/httpresponse/read_body_spec.rb +85 -0
  154. data/spec/httpresponse/read_header_spec.rb +8 -0
  155. data/spec/httpresponse/read_new_spec.rb +21 -0
  156. data/spec/httpresponse/reading_body_spec.rb +57 -0
  157. data/spec/httpresponse/response_spec.rb +8 -0
  158. data/spec/httpresponse/shared/body.rb +18 -0
  159. data/spec/httpresponse/to_ary_spec.rb +25 -0
  160. data/spec/httpresponse/value_spec.rb +23 -0
  161. metadata +366 -88
  162. data/lib/rubysl-net-http.rb +0 -9
@@ -0,0 +1,38 @@
1
+ require 'net/http'
2
+
3
+ describe "Net::HTTP.proxy_user" do
4
+ describe "when self is no proxy class" do
5
+ it "returns nil" do
6
+ Net::HTTP.proxy_user.should be_nil
7
+ end
8
+ end
9
+
10
+ describe "when self is a proxy class" do
11
+ it "returns nil if no username was set for self's proxy connection" do
12
+ Net::HTTP.Proxy("localhost").proxy_user.should be_nil
13
+ end
14
+
15
+ it "returns the username for self's proxy connection" do
16
+ Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks").proxy_user.should == "rspec"
17
+ end
18
+ end
19
+ end
20
+
21
+ describe "Net::HTTP#proxy_user" do
22
+ describe "when self is no proxy class instance" do
23
+ it "returns nil" do
24
+ Net::HTTP.new("localhost", 3333).proxy_user.should be_nil
25
+ end
26
+ end
27
+
28
+ describe "when self is a proxy class instance" do
29
+ it "returns nil if no username was set for self's proxy connection" do
30
+ Net::HTTP.Proxy("localhost").new("localhost", 3333).proxy_user.should be_nil
31
+ end
32
+
33
+ it "returns the username for self's proxy connection" do
34
+ http_with_proxy = Net::HTTP.Proxy("localhost", 1234, "rspec", "rocks")
35
+ http_with_proxy.new("localhost", 3333).proxy_user.should == "rspec"
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,7 @@
1
+ require 'net/http'
2
+ require File.expand_path('../fixtures/http_server', __FILE__)
3
+ require File.expand_path('../shared/request_put', __FILE__)
4
+
5
+ describe "Net::HTTP#put2" do
6
+ it_behaves_like :net_ftp_request_put, :put2
7
+ end
@@ -0,0 +1,29 @@
1
+ require 'net/http'
2
+ require File.expand_path('../fixtures/http_server', __FILE__)
3
+
4
+ describe "Net::HTTP#put" do
5
+ before(:all) do
6
+ NetHTTPSpecs.start_server
7
+ end
8
+
9
+ after(:all) do
10
+ NetHTTPSpecs.stop_server
11
+ end
12
+
13
+ before(:each) do
14
+ @http = Net::HTTP.start("localhost", 3333)
15
+ end
16
+
17
+ after(:each) do
18
+ @http.finish if @http.started?
19
+ end
20
+
21
+ it "sends an put request to the passed path and returns the response" do
22
+ response = @http.put("/request", "test=test")
23
+ response.body.should == "Request type: PUT"
24
+ end
25
+
26
+ it "returns a Net::HTTPResponse" do
27
+ @http.put("/request", "test=test").should be_kind_of(Net::HTTPResponse)
28
+ end
29
+ end
@@ -0,0 +1,23 @@
1
+ require 'net/http'
2
+
3
+ describe "Net::HTTP#read_timeout" do
4
+ it "returns the seconds to wait until reading one block" do
5
+ net = Net::HTTP.new("localhost")
6
+ net.read_timeout.should eql(60)
7
+ net.read_timeout = 10
8
+ net.read_timeout.should eql(10)
9
+ end
10
+ end
11
+
12
+ describe "Net::HTTP#read_timeout=" do
13
+ it "sets the seconds to wait till the connection is open" do
14
+ net = Net::HTTP.new("localhost")
15
+ net.read_timeout = 10
16
+ net.read_timeout.should eql(10)
17
+ end
18
+
19
+ it "returns the newly set value" do
20
+ net = Net::HTTP.new("localhost")
21
+ (net.read_timeout = 10).should eql(10)
22
+ end
23
+ end
@@ -0,0 +1,7 @@
1
+ require 'net/http'
2
+ require File.expand_path('../fixtures/http_server', __FILE__)
3
+ require File.expand_path('../shared/request_get', __FILE__)
4
+
5
+ describe "Net::HTTP#request_get" do
6
+ it_behaves_like :net_ftp_request_get, :get2
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'net/http'
2
+ require File.expand_path('../fixtures/http_server', __FILE__)
3
+ require File.expand_path('../shared/request_head', __FILE__)
4
+
5
+ describe "Net::HTTP#request_head" do
6
+ it_behaves_like :net_ftp_request_head, :request_head
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'net/http'
2
+ require File.expand_path('../fixtures/http_server', __FILE__)
3
+ require File.expand_path('../shared/request_post', __FILE__)
4
+
5
+ describe "Net::HTTP#request_post" do
6
+ it_behaves_like :net_ftp_request_post, :request_post
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'net/http'
2
+ require File.expand_path('../fixtures/http_server', __FILE__)
3
+ require File.expand_path('../shared/request_put', __FILE__)
4
+
5
+ describe "Net::HTTP#request_put" do
6
+ it_behaves_like :net_ftp_request_put, :request_put
7
+ end
@@ -0,0 +1,114 @@
1
+ require 'net/http'
2
+ require File.expand_path('../fixtures/http_server', __FILE__)
3
+
4
+ describe "Net::HTTP#request" do
5
+ before(:all) do
6
+ NetHTTPSpecs.start_server
7
+ end
8
+
9
+ after(:all) do
10
+ NetHTTPSpecs.stop_server
11
+ end
12
+
13
+ before(:each) do
14
+ @http = Net::HTTP.start("localhost", 3333)
15
+ end
16
+
17
+ after(:each) do
18
+ @http.finish if @http.started?
19
+ end
20
+
21
+ describe "when passed request_object" do
22
+ it "makes a HTTP Request based on the passed request_object" do
23
+ response = @http.request(Net::HTTP::Get.new("/request"), "test=test")
24
+ response.body.should == "Request type: GET"
25
+
26
+ response = @http.request(Net::HTTP::Head.new("/request"), "test=test")
27
+ response.body.should be_nil
28
+
29
+ response = @http.request(Net::HTTP::Post.new("/request"), "test=test")
30
+ response.body.should == "Request type: POST"
31
+
32
+ response = @http.request(Net::HTTP::Put.new("/request"), "test=test")
33
+ response.body.should == "Request type: PUT"
34
+
35
+ response = @http.request(Net::HTTP::Proppatch.new("/request"), "test=test")
36
+ response.body.should == "Request type: PROPPATCH"
37
+
38
+ response = @http.request(Net::HTTP::Lock.new("/request"), "test=test")
39
+ response.body.should == "Request type: LOCK"
40
+
41
+ response = @http.request(Net::HTTP::Unlock.new("/request"), "test=test")
42
+ response.body.should == "Request type: UNLOCK"
43
+
44
+ # TODO: Does not work?
45
+ #response = @http.request(Net::HTTP::Options.new("/request"), "test=test")
46
+ #response.body.should be_nil
47
+
48
+ response = @http.request(Net::HTTP::Propfind.new("/request"), "test=test")
49
+ response.body.should == "Request type: PROPFIND"
50
+
51
+ response = @http.request(Net::HTTP::Delete.new("/request"), "test=test")
52
+ response.body.should == "Request type: DELETE"
53
+
54
+ response = @http.request(Net::HTTP::Move.new("/request"), "test=test")
55
+ response.body.should == "Request type: MOVE"
56
+
57
+ response = @http.request(Net::HTTP::Copy.new("/request"), "test=test")
58
+ response.body.should == "Request type: COPY"
59
+
60
+ response = @http.request(Net::HTTP::Mkcol.new("/request"), "test=test")
61
+ response.body.should == "Request type: MKCOL"
62
+
63
+ response = @http.request(Net::HTTP::Trace.new("/request"), "test=test")
64
+ response.body.should == "Request type: TRACE"
65
+ end
66
+ end
67
+
68
+ describe "when passed request_object and request_body" do
69
+ it "sends the passed request_body when making the HTTP Request" do
70
+ response = @http.request(Net::HTTP::Get.new("/request/body"), "test=test")
71
+ response.body.should == "test=test"
72
+
73
+ response = @http.request(Net::HTTP::Head.new("/request/body"), "test=test")
74
+ response.body.should be_nil
75
+
76
+ response = @http.request(Net::HTTP::Post.new("/request/body"), "test=test")
77
+ response.body.should == "test=test"
78
+
79
+ response = @http.request(Net::HTTP::Put.new("/request/body"), "test=test")
80
+ response.body.should == "test=test"
81
+
82
+ response = @http.request(Net::HTTP::Proppatch.new("/request/body"), "test=test")
83
+ response.body.should == "test=test"
84
+
85
+ response = @http.request(Net::HTTP::Lock.new("/request/body"), "test=test")
86
+ response.body.should == "test=test"
87
+
88
+ response = @http.request(Net::HTTP::Unlock.new("/request/body"), "test=test")
89
+ response.body.should == "test=test"
90
+
91
+ # TODO: Does not work?
92
+ #response = @http.request(Net::HTTP::Options.new("/request/body"), "test=test")
93
+ #response.body.should be_nil
94
+
95
+ response = @http.request(Net::HTTP::Propfind.new("/request/body"), "test=test")
96
+ response.body.should == "test=test"
97
+
98
+ response = @http.request(Net::HTTP::Delete.new("/request/body"), "test=test")
99
+ response.body.should == "test=test"
100
+
101
+ response = @http.request(Net::HTTP::Move.new("/request/body"), "test=test")
102
+ response.body.should == "test=test"
103
+
104
+ response = @http.request(Net::HTTP::Copy.new("/request/body"), "test=test")
105
+ response.body.should == "test=test"
106
+
107
+ response = @http.request(Net::HTTP::Mkcol.new("/request/body"), "test=test")
108
+ response.body.should == "test=test"
109
+
110
+ response = @http.request(Net::HTTP::Trace.new("/request/body"), "test=test")
111
+ response.body.should == "test=test"
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,253 @@
1
+ require 'net/http'
2
+
3
+ describe "Net::HTTP::Get" do
4
+ it "is a subclass of Net::HTTPRequest" do
5
+ Net::HTTP::Get.should < Net::HTTPRequest
6
+ end
7
+
8
+ it "represents the 'GET'-Request-Method" do
9
+ Net::HTTP::Get::METHOD.should == "GET"
10
+ end
11
+
12
+ it "has no Request Body" do
13
+ Net::HTTP::Get::REQUEST_HAS_BODY.should be_false
14
+ end
15
+
16
+ it "has a Respone Body" do
17
+ Net::HTTP::Get::RESPONSE_HAS_BODY.should be_true
18
+ end
19
+ end
20
+
21
+ describe "Net::HTTP::Head" do
22
+ it "is a subclass of Net::HTTPRequest" do
23
+ Net::HTTP::Head.should < Net::HTTPRequest
24
+ end
25
+
26
+ it "represents the 'HEAD'-Request-Method" do
27
+ Net::HTTP::Head::METHOD.should == "HEAD"
28
+ end
29
+
30
+ it "has no Request Body" do
31
+ Net::HTTP::Head::REQUEST_HAS_BODY.should be_false
32
+ end
33
+
34
+ it "has no Respone Body" do
35
+ Net::HTTP::Head::RESPONSE_HAS_BODY.should be_false
36
+ end
37
+ end
38
+
39
+ describe "Net::HTTP::Post" do
40
+ it "is a subclass of Net::HTTPRequest" do
41
+ Net::HTTP::Post.should < Net::HTTPRequest
42
+ end
43
+
44
+ it "represents the 'POST'-Request-Method" do
45
+ Net::HTTP::Post::METHOD.should == "POST"
46
+ end
47
+
48
+ it "has a Request Body" do
49
+ Net::HTTP::Post::REQUEST_HAS_BODY.should be_true
50
+ end
51
+
52
+ it "has a Respone Body" do
53
+ Net::HTTP::Post::RESPONSE_HAS_BODY.should be_true
54
+ end
55
+ end
56
+
57
+ describe "Net::HTTP::Put" do
58
+ it "is a subclass of Net::HTTPRequest" do
59
+ Net::HTTP::Put.should < Net::HTTPRequest
60
+ end
61
+
62
+ it "represents the 'PUT'-Request-Method" do
63
+ Net::HTTP::Put::METHOD.should == "PUT"
64
+ end
65
+
66
+ it "has a Request Body" do
67
+ Net::HTTP::Put::REQUEST_HAS_BODY.should be_true
68
+ end
69
+
70
+ it "has a Respone Body" do
71
+ Net::HTTP::Put::RESPONSE_HAS_BODY.should be_true
72
+ end
73
+ end
74
+
75
+ describe "Net::HTTP::Delete" do
76
+ it "is a subclass of Net::HTTPRequest" do
77
+ Net::HTTP::Delete.should < Net::HTTPRequest
78
+ end
79
+
80
+ it "represents the 'DELETE'-Request-Method" do
81
+ Net::HTTP::Delete::METHOD.should == "DELETE"
82
+ end
83
+
84
+ it "has no Request Body" do
85
+ Net::HTTP::Delete::REQUEST_HAS_BODY.should be_false
86
+ end
87
+
88
+ it "has a Respone Body" do
89
+ Net::HTTP::Delete::RESPONSE_HAS_BODY.should be_true
90
+ end
91
+ end
92
+
93
+ describe "Net::HTTP::Options" do
94
+ it "is a subclass of Net::HTTPRequest" do
95
+ Net::HTTP::Options.should < Net::HTTPRequest
96
+ end
97
+
98
+ it "represents the 'OPTIONS'-Request-Method" do
99
+ Net::HTTP::Options::METHOD.should == "OPTIONS"
100
+ end
101
+
102
+ it "has no Request Body" do
103
+ Net::HTTP::Options::REQUEST_HAS_BODY.should be_false
104
+ end
105
+
106
+ it "has no Respone Body" do
107
+ Net::HTTP::Options::RESPONSE_HAS_BODY.should be_false
108
+ end
109
+ end
110
+
111
+ describe "Net::HTTP::Trace" do
112
+ it "is a subclass of Net::HTTPRequest" do
113
+ Net::HTTP::Trace.should < Net::HTTPRequest
114
+ end
115
+
116
+ it "represents the 'TRACE'-Request-Method" do
117
+ Net::HTTP::Trace::METHOD.should == "TRACE"
118
+ end
119
+
120
+ it "has no Request Body" do
121
+ Net::HTTP::Trace::REQUEST_HAS_BODY.should be_false
122
+ end
123
+
124
+ it "has a Respone Body" do
125
+ Net::HTTP::Trace::RESPONSE_HAS_BODY.should be_true
126
+ end
127
+ end
128
+
129
+ describe "Net::HTTP::Propfind" do
130
+ it "is a subclass of Net::HTTPRequest" do
131
+ Net::HTTP::Propfind.should < Net::HTTPRequest
132
+ end
133
+
134
+ it "represents the 'PROPFIND'-Request-Method" do
135
+ Net::HTTP::Propfind::METHOD.should == "PROPFIND"
136
+ end
137
+
138
+ it "has a Request Body" do
139
+ Net::HTTP::Propfind::REQUEST_HAS_BODY.should be_true
140
+ end
141
+
142
+ it "has a Respone Body" do
143
+ Net::HTTP::Propfind::RESPONSE_HAS_BODY.should be_true
144
+ end
145
+ end
146
+
147
+ describe "Net::HTTP::Proppatch" do
148
+ it "is a subclass of Net::HTTPRequest" do
149
+ Net::HTTP::Proppatch.should < Net::HTTPRequest
150
+ end
151
+
152
+ it "represents the 'PROPPATCH'-Request-Method" do
153
+ Net::HTTP::Proppatch::METHOD.should == "PROPPATCH"
154
+ end
155
+
156
+ it "has a Request Body" do
157
+ Net::HTTP::Proppatch::REQUEST_HAS_BODY.should be_true
158
+ end
159
+
160
+ it "has a Respone Body" do
161
+ Net::HTTP::Proppatch::RESPONSE_HAS_BODY.should be_true
162
+ end
163
+ end
164
+
165
+ describe "Net::HTTP::Mkcol" do
166
+ it "is a subclass of Net::HTTPRequest" do
167
+ Net::HTTP::Mkcol.should < Net::HTTPRequest
168
+ end
169
+
170
+ it "represents the 'MKCOL'-Request-Method" do
171
+ Net::HTTP::Mkcol::METHOD.should == "MKCOL"
172
+ end
173
+
174
+ it "has a Request Body" do
175
+ Net::HTTP::Mkcol::REQUEST_HAS_BODY.should be_true
176
+ end
177
+
178
+ it "has a Respone Body" do
179
+ Net::HTTP::Mkcol::RESPONSE_HAS_BODY.should be_true
180
+ end
181
+ end
182
+
183
+ describe "Net::HTTP::Copy" do
184
+ it "is a subclass of Net::HTTPRequest" do
185
+ Net::HTTP::Copy.should < Net::HTTPRequest
186
+ end
187
+
188
+ it "represents the 'COPY'-Request-Method" do
189
+ Net::HTTP::Copy::METHOD.should == "COPY"
190
+ end
191
+
192
+ it "has no Request Body" do
193
+ Net::HTTP::Copy::REQUEST_HAS_BODY.should be_false
194
+ end
195
+
196
+ it "has a Respone Body" do
197
+ Net::HTTP::Copy::RESPONSE_HAS_BODY.should be_true
198
+ end
199
+ end
200
+
201
+ describe "Net::HTTP::Move" do
202
+ it "is a subclass of Net::HTTPRequest" do
203
+ Net::HTTP::Move.should < Net::HTTPRequest
204
+ end
205
+
206
+ it "represents the 'MOVE'-Request-Method" do
207
+ Net::HTTP::Move::METHOD.should == "MOVE"
208
+ end
209
+
210
+ it "has no Request Body" do
211
+ Net::HTTP::Move::REQUEST_HAS_BODY.should be_false
212
+ end
213
+
214
+ it "has a Respone Body" do
215
+ Net::HTTP::Move::RESPONSE_HAS_BODY.should be_true
216
+ end
217
+ end
218
+
219
+ describe "Net::HTTP::Lock" do
220
+ it "is a subclass of Net::HTTPRequest" do
221
+ Net::HTTP::Lock.should < Net::HTTPRequest
222
+ end
223
+
224
+ it "represents the 'LOCK'-Request-Method" do
225
+ Net::HTTP::Lock::METHOD.should == "LOCK"
226
+ end
227
+
228
+ it "has a Request Body" do
229
+ Net::HTTP::Lock::REQUEST_HAS_BODY.should be_true
230
+ end
231
+
232
+ it "has a Respone Body" do
233
+ Net::HTTP::Lock::RESPONSE_HAS_BODY.should be_true
234
+ end
235
+ end
236
+
237
+ describe "Net::HTTP::Unlock" do
238
+ it "is a subclass of Net::HTTPRequest" do
239
+ Net::HTTP::Unlock.should < Net::HTTPRequest
240
+ end
241
+
242
+ it "represents the 'UNLOCK'-Request-Method" do
243
+ Net::HTTP::Unlock::METHOD.should == "UNLOCK"
244
+ end
245
+
246
+ it "has a Request Body" do
247
+ Net::HTTP::Unlock::REQUEST_HAS_BODY.should be_true
248
+ end
249
+
250
+ it "has a Respone Body" do
251
+ Net::HTTP::Unlock::RESPONSE_HAS_BODY.should be_true
252
+ end
253
+ end