Setting an expectation from a RequestStub #83

afeld opened this Issue Apr 8, 2011 · 3 comments


None yet

2 participants

afeld commented Apr 8, 2011

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 Jun 5, 2011

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

afeld commented Jun 6, 2011

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

afeld commented Jun 6, 2011

See pull request #103.

@afeld afeld closed this Jun 6, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment