You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to implement this for my project's needs, I created an MKTVerificationMode and followed the same idea of this commit: drodriguez@a77e2e9.
It's basically an infinite while loop that ends when the MKTVerificationData's numberOfMatchingInvocations becomes _wanted or it times out.
After using it in several different tests I identified an interesting problem: this approach doesn't work well with HCArgumentCaptors. HCArgumentCaptor's implementation will basically catch every call to -match for that argument. In this case, there might be multiple attempts to match that argument before we have a fully successful match, so many things will be captured in HCArgumentCaptor's values. The behavior (amount of values captured) will actually be unpredictable and might break some tests as mine did a few times.
I thought I'd mention it just in case you consider including that part of the code or a variation of it too. Make sure you test this scenario.
jonreid
changed the title
Async testing: verify with timeout
Feature request: Async verify with timeout
May 30, 2016
Possibly a new MKTVerificationMode, or possibly verifyWithTimeout
The text was updated successfully, but these errors were encountered: