Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

call Net::HTTP#finish to close sockets.

  • Loading branch information...
commit a82c48867f98cd8496e6a02f12d44ca922f9102b 1 parent f88a318
@akr akr authored
View
4 library/net/http/http/copy_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends a COPY request to the passed path and returns the response" do
response = @http.copy("/request")
response.should be_kind_of(Net::HTTPResponse)
View
4 library/net/http/http/delete_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends a DELETE request to the passed path and returns the response" do
response = @http.delete("/request")
response.should be_kind_of(Net::HTTPResponse)
View
1  library/net/http/http/get_spec.rb
@@ -31,6 +31,7 @@
end
after(:each) do
+ @http.finish
Net::HTTP.version_1_2
end
View
4 library/net/http/http/head_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends a HEAD request to the passed path and returns the response" do
response = @http.head("/request")
# HEAD requests have no responses
View
4 library/net/http/http/lock_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends a LOCK request to the passed path and returns the response" do
response = @http.lock("/request", "test=test")
response.should be_kind_of(Net::HTTPResponse)
View
4 library/net/http/http/mkcol_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends a MKCOL request to the passed path and returns the response" do
response = @http.mkcol("/request")
response.should be_kind_of(Net::HTTPResponse)
View
4 library/net/http/http/move_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends a MOVE request to the passed path and returns the response" do
response = @http.move("/request")
# HEAD requests have no responses
View
4 library/net/http/http/options_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends an options request to the passed path and returns the response" do
response = @http.options("/request")
# OPTIONS responses have no bodies
View
4 library/net/http/http/post_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends an post request to the passed path and returns the response" do
response = @http.post("/request", "test=test")
response.body.should == "Request type: POST"
View
4 library/net/http/http/propfind_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends an propfind request to the passed path and returns the response" do
response = @http.propfind("/request", "test=test")
response.body.should == "Request type: PROPFIND"
View
4 library/net/http/http/proppatch_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends an proppatch request to the passed path and returns the response" do
response = @http.proppatch("/request", "test=test")
response.body.should == "Request type: PROPPATCH"
View
4 library/net/http/http/put_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends an put request to the passed path and returns the response" do
response = @http.put("/request", "test=test")
response.body.should == "Request type: PUT"
View
4 library/net/http/http/request_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
describe "when passed request_object" do
it "makes a HTTP Request based on the passed request_object" do
response = @http.request(Net::HTTP::Get.new("/request"), "test=test")
View
4 library/net/http/http/send_request_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
# TODO: Does only work with GET and POST requests
describe "when passed type, path" do
it "sends a HTTP Request of the passed type to the passed path" do
View
4 library/net/http/http/shared/request_get.rb
@@ -11,6 +11,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
describe "when passed no block" do
it "sends a GET request to the passed path and returns the response" do
response = @http.send(@method, "/request")
View
4 library/net/http/http/shared/request_head.rb
@@ -11,6 +11,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
describe "when passed no block" do
it "sends a head request to the passed path and returns the response" do
response = @http.send(@method, "/request")
View
4 library/net/http/http/shared/request_post.rb
@@ -11,6 +11,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
describe "when passed no block" do
it "sends a post request to the passed path and returns the response" do
response = @http.send(@method, "/request", "test=test")
View
4 library/net/http/http/shared/request_put.rb
@@ -11,6 +11,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
describe "when passed no block" do
it "sends a put request to the passed path and returns the response" do
response = @http.send(@method, "/request", "test=test")
View
9 library/net/http/http/start_spec.rb
@@ -16,10 +16,13 @@
net.should be_kind_of(Net::HTTP)
net.address.should == "localhost"
net.port.should == 3333
+ net.finish
end
it "opens the tcp connection" do
- Net::HTTP.start("localhost", 3333).started?.should be_true
+ net = Net::HTTP.start("localhost", 3333)
+ net.started?.should be_true
+ net.finish
end
describe "when passed a block" do
@@ -61,6 +64,10 @@
@http = Net::HTTP.new("localhost", 3333)
end
+ after(:each) do
+ @http.finish if @http.started?
+ end
+
it "returns self" do
@http.start.should equal(@http)
end
View
4 library/net/http/http/trace_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends a TRACE request to the passed path and returns the response" do
response = @http.trace("/request")
response.body.should == "Request type: TRACE"
View
4 library/net/http/http/unlock_spec.rb
@@ -15,6 +15,10 @@
@http = Net::HTTP.start("localhost", 3333)
end
+ after(:each) do
+ @http.finish
+ end
+
it "sends an UNLOCK request to the passed path and returns the response" do
response = @http.unlock("/request", "test=test")
response.body.should == "Request type: UNLOCK"
Please sign in to comment.
Something went wrong with that request. Please try again.