First off thanks for this very useful shard! 🙇
Would it be possible add the option to sneak in
a sleep before the stubbed response is returned?
I'm thinking along the lines of:
WebMock.stub(:post, "www.example.com/foo").
with(body: "abc", headers: {"Content-Type" => "text/plain"}).
to_return(status: 500, body: "oops", headers: {"X-Error" => "true"})
.after(2.seconds) # 👈
This would make it easy to exercise timeout conditions and concurrency scenarios
which are otherwise notoriously hard to test - and a common source of bugs.