If you make a web request in a test that isn't registered, WebMock will raise an exception, suggest how you can mock it, and list all the previously registered mocks:
I'd like to be able to dump all the registered mocks, just like the green-circled section above. How can I do that?
I've tried several invocations along these lines, without success:
snippet = WebMock::RequestSignatureSnippet.new(nil)
puts snippet.request_stubs
But I get this error on the first line:
ArgumentError:
wrong number of arguments (given 0, expected 1)
# ./spec/models/user_spec.rb:113:in `new'
While I don't understand the wrong number of argument error, (I am passing it a nil, afterall) I suspect I'm just barking up the wrong tree and there's a simple way to do this. I haven't found any reference in the docs or searching online.
I could duplicate code and write my own dumper, but that seems silly.
Is there a simple way to get a formatted dump of all the registered webmocks, short of making a bad network request?
