Skip to content


Setting an expectation from a RequestStub #83

afeld opened this Issue · 3 comments

2 participants


Currently, there is a lot of duplicated code when doing webmock stubs and then expectations, i.e.

stub_request(:any, "").with( ... )
## stuff happens ##
WebMock.should have_requested(:get, "").with( ... ).twice

The details in those ellipses (...) can get really long - it would be nice (and more DRY) to be able to set expectations directly on RequestStubs, i.e.

@request = stub_request(:any, "").with( ... )
## stuff happens ##
@request.should have_been_made.twice
jcf commented

This sounds like a nice idea. Fancy having a stab at the implementation and sending a pull request?


Sure - just wasn't sure if they were intentionally separated.


See pull request #103.

@afeld afeld closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.