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?
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/04b8bc47-c8e6-48e3-8923-ef75a8eff5ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.