We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 596d8a8 + c6cf2f1 commit 801ad3bCopy full SHA for 801ad3b
2 files changed
lib/webmock/http_lib_adapters/curb_adapter.rb
@@ -313,6 +313,7 @@ def body_str
313
def response_code
314
@response_code ||= super
315
end
316
+ alias code response_code
317
318
def header_str
319
@header_str ||= super
spec/acceptance/curb/curb_spec.rb
@@ -373,6 +373,15 @@
373
expect(c.body).to eq("abc")
374
375
376
+ it "should alias code to response_code" do
377
+ stub_request(:get, "www.example.com").to_return(status: 456)
378
+
379
+ c = Curl::Easy.new
380
+ c.url = "http://www.example.com"
381
+ c.http(:GET)
382
+ expect(c.code).to eq(456)
383
+ end
384
385
it "supports array headers passed to Curl::Easy" do
386
stub_request(:get, "www.example.com").with(headers: {'X-One' => '1'}).to_return(body: "abc")
387
0 commit comments