webmock icon indicating copy to clipboard operation
webmock copied to clipboard

Specifying http method as a string doesn't work

Open deadeyejoe opened this issue 6 years ago • 1 comments

I'm using webmock v3.5.1 on ruby 2.6.1

The following example will fail:

stub_request("get","http://example.com")
HTTParty.get("http://example.com")

And the output includes the text

registered request stubs:
     
stub_request(:get, "http://example.com/")

I think this is needlessly confusing: the output clearly implies that it's valid to pass the method as a string or a symbol.

deadeyejoe avatar May 27 '19 11:05 deadeyejoe

I agree there is no harm of accepting both symbol or string. The change will have to be applied and tested against not only stub_request but a_request, have_requested and all WebMock public methods that accept the method argument. I'll be happy to accept a PR with the change.

bblimke avatar Jul 13 '19 22:07 bblimke