Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use with expect? #19

Open
georgeu2000 opened this issue Oct 8, 2017 · 2 comments
Open

How to use with expect? #19

georgeu2000 opened this issue Oct 8, 2017 · 2 comments

Comments

@georgeu2000
Copy link

      expect(WebMock).to have_requested(:get, "http://google.com").once

Is this supported?

@watzon
Copy link

watzon commented Feb 28, 2018

Also wanting to know this. The ruby version of webmock has the a_request method, something like that would be nice.

@jackturnbull
Copy link

jackturnbull commented Feb 17, 2019

Late to the party but I've decided to comment for once because this is the second time I've figured this out from looking into the source (tried it last year and since forgot).

mock = WebMock.stub(:get, url).to_return(body: "")
HTTP::Client.get(url)
mock.calls.should eq 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants