README could show how to list the RequestRegistry #315

Closed
mrjcleaver opened this Issue Oct 15, 2013 · 6 comments

Comments

Projects
None yet
2 participants

I know its somewhere in the code, and I'll find it, but it would be useful if the README file showed how to get to WebMock's list of all requests and responses that it usually only shows when a test fails.

Yes, I do have VCR, but I assume Webmock doesn't actually need it to get hold of that list.

Seems to be WebMock.RequestRegistry.instance.to_s ?

Owner

bblimke commented Oct 16, 2013

RequestRegistry is an internal part of the WebMock, not part of the API.

If you need to print these requests, feel free. WebMock.RequestRegistry.instance.to_s does that indeed.

Oh - okay - but it seemed useful!

I thought it would work, but it doesn't. Would you mind telling me whether it was in the same place on webmock 1.7.10?

I wrote:

    require 'webmock'
    require 'webmock/rspec'
    require 'webmock/rspec/matchers'

    include WebMock::API
    include WebMock::Matchers

    puts WebMock.RequestRegistry.instance.to_s

But got:

 Failure/Error: Unable to find matching line from backtrace
 NoMethodError:
   undefined method `RequestRegistry' for WebMock:Module

I'm using version 1.7.10 because logstash breaks on later versions.

Thanks kindly,
Martin

Owner

bblimke commented Oct 16, 2013

WebMock::RequestRegistry not WebMock.RequestRegistry

Thank you Bartosz! (& thanks for your patience!)

mrjcleaver closed this Oct 16, 2013

Owner

bblimke commented Oct 16, 2013

No probs. Glad it works. Should you have any more questions, feel free to ask and I'll answer if time allows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment