-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Async verify with timeout #112
Comments
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. |
Possibly a new MKTVerificationMode, or possibly verifyWithTimeout
The text was updated successfully, but these errors were encountered: