I have a call path where a given method
SomeClass.rate_limit(key, max_every: seconds)
is invoked several times, and I'd like to ensure that a certain choice of arguments is among those calls
expect(SomeClass).to receive(:rate_limit).with("foo", max_every: 10.seconds)
I don't care about the rest.
I don't see how to make that pass, due to the multiple invocations of the method. The expectation fails because some other combination was found (albeit eventually the expected one is going to be present). Sometimes you can throw
allow(SomeClass).to receive(:rate_limit)
just before the expectation, but this time, it is not enough, perhaps because there are several partial matches (but have not investigated it).
Is there a way to accomplish that?