Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow to pass URI for a request

  • Loading branch information...
commit f48d4cde97bf3625c911ff42d7562c48ddd3fc07 1 parent b2b57c1
@drogus drogus authored
Showing with 8 additions and 1 deletion.
  1. +1 −1  lib/kirk/client/exchange.rb
  2. +7 −0 spec/client/client_spec.rb
View
2  lib/kirk/client/exchange.rb
@@ -22,7 +22,7 @@ def prepare!(request)
self.request = request
self.response = Response.new(!handler.respond_to?(:on_response_body))
self.method = request.method
- self.url = request.url
+ self.url = request.url.to_s
if request.headers
request.headers.each do |name, val|
View
7 spec/client/client_spec.rb
@@ -38,6 +38,13 @@
response["REQUEST_METHOD"].should == "DELETE"
end
+ it "does not freak out when URI is passed" do
+ response = Kirk::Client.get(URI.parse("http://localhost:9090/foo"))
+ response = parse_response(response)
+ response["PATH_INFO"].should == "/foo"
+ response["REQUEST_METHOD"].should == "GET"
+ end
+
it "allows to pass block for request" do
handler = Class.new do
def initialize(buffer)
Please sign in to comment.
Something went wrong with that request. Please try again.