For now in my code I'm using the following pattern a lot:
a_request(:get, "http://example.com/nodes/shard2").should have_been_made
What do you think about providing ability to use lambda syntax for such tests?
}.should make_request(:get, "http://example.com/nodes/shard2").with(...)
(BTW: Maybe I'm missing something and it is already possible?)
WebMock by design follows stub-execute-verify philosophy.
It separates these 3 steps and allows each of them to be performed exclusively.
RSpec combines stub+verify i.e. should_receive, which is ok, but different.
WebMock also uses global stubs and executed requests registry.
To implement this approach, WebMock would require some kind of registry per lambda.
I'm not sure it's obvious that ".should make_request" also stubs the request.
I like this syntax though, so I'd like to add it to WebMock, but only if there is any clear way
to add it to current WebMock's architecture.