-
-
Notifications
You must be signed in to change notification settings - Fork 592
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
Should async tests use XCTestExpectation? #28
Comments
+1, I think it'd be interesting to explore whether this is possible. Simply wrapping async functionality in XCTest might more stable, in the long run, than re-inventing that functionality in Nimble. |
When considering test frameworks I've always thought it a plus when the default stuff was used under the hood. |
Last time I checked those methods work only if you're directly inside the test case, that would mean you would need to pass self (the test case instance) through nimble explicitly. |
I can confirm that |
That would require strange syntax to achieve properly in Nimble like:
Without some hackery or coordination with Quick (esp with shared examples). I see using a implementation under the hood when appropriate. It can be a negative since it's tightly coupling to an external dependency. See Kiwi, Specta, and Cedar - which Xcode 6 test bundle support is in flux because of internal changes Apple has made. Using private APIs is a requirement if you want to do anything beyond what Apple conservatively exposes. I rather have something that doesn't support the latest wizbang feature from Apple instead of not working at all. But maybe my risk-factor is different from yours. |
I'm going to close this issue for now unless something changes in APIs or someone comes up with a good solution that doesn't require a major change in the general syntax. Using the public stuff would be great if possible. |
any updates 2 years later? :) |
Nope! Same as before: Thanks for the follow up, though! It's fun looking back on this decision, especially since I think we made the right one here. :) |
@tonyxiao Is there something that you're missing from |
@modocache not specifically. I liked the fact that |
XCTestCase's wait for expectations method does pretty much the same thing, waiting for any outstanding expectations to be fulfilled. It is nice that you can call it once to wait for all expectations. On the other hand, you can't wait for individual expectations. On Fri, Jul 1, 2016 at 5:42 PM -0400, "tonyxiao" notifications@github.com wrote: @modocache not specifically. I liked the fact that XCTestExpectation seems explicit about promises being fulfilled whereas expect(...).toEventually(...) repeatedly checks value until expectation satisfies. Not sure how much difference that actually makes in every day usage. — |
Got it. Thank you for the clarification! |
What about performance testing btw? Does Quick have something equivalent to measureBlock? |
how to "expect(...).toEventually("ManyEquals here")" ?) |
Fix typo in Quickspec.m
Related to Quick/Quick#132
I was wondering if there was a reason why
toEventually
, etc don't useXCTestExpectation
internally viaexpectationWithDescription
,waitForExpectationsWithTimeout
, andfulfill
.The text was updated successfully, but these errors were encountered: