Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add some missing Curl::Easy aliases

  • Loading branch information...
commit 564c40457cee30185f8880add19eb4efef54a703 1 parent 628c4b0
@hc5duke hc5duke authored
View
4 lib/webmock/http_lib_adapters/curb_adapter.rb
@@ -200,12 +200,14 @@ def http_put data = nil
@put_data = data if data
super
end
+ alias put http_put
def http_post *data
@webmock_method = :post
@post_body = data.join('&') if data && !data.empty?
super
end
+ alias post http_post
def perform
@webmock_method ||= :get
@@ -236,6 +238,7 @@ def head= value
def body_str
@body_str || super
end
+ alias body body_str
def response_code
@response_code || super
@@ -244,6 +247,7 @@ def response_code
def header_str
@header_str || super
end
+ alias head header_str
def last_effective_url
@last_effective_url || super
View
9 spec/acceptance/curb/curb_spec.rb
@@ -331,6 +331,15 @@
c.http(:GET)
c.body_str.should == "abc"
end
+
+ it "should alias body to body_str" do
+ stub_request(:get, "www.example.com").to_return(:body => "abc")
+
+ c = Curl::Easy.new
+ c.url = "http://www.example.com"
+ c.http(:GET)
+ c.body.should == "abc"
+ end
end
describe "using #http_* methods for requests" do
Please sign in to comment.
Something went wrong with that request. Please try again.