manastech/webmock.cr

How to use with expect?

Opened this issue · 2 comments

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

Is this supported?

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

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