webmock
webmock copied to clipboard
Specifying http method as a string doesn't work
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.
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.