Thursday, September 18, 2014 [Tweets]

Xcode 6.0.1 Asynchronous Tests

The documentation only shows one type of XCTestExpectation, but there are actually several different methods for creating them:

@interface XCTestCase (AsynchronousTesting)
- (XCTestExpectation *)expectationWithDescription:(NSString *)description;
- (XCTestExpectation *)keyValueObservingExpectationForObject:(id)objectToObserve 
                                                     keyPath:(NSString *)keyPath 
                                               expectedValue:(id)expectedValue;
- (XCTestExpectation *)keyValueObservingExpectationForObject:(id)objectToObserve 
                                                     keyPath:(NSString *)keyPath 
                                                     handler:(XCKeyValueObservingExpectationHandler)handlerOrNil;
- (XCTestExpectation *)expectationForNotification:(NSString *)notificationName 
                                           object:(id)objectToObserve 
                                          handler:(XCNotificationExpectationHandler)handlerOrNil;
@end

These are documented in XCTextCase+AsynchronousTesting.h.

2 Comments

FWIW, @mattstevens has published an XCTest Xcode 5.0 to Xcode 6.0 API diff https://twitter.com/mattstevens/status/512651416654340096 generated from his objc-diff tool https://github.com/mattstevens/objc-diff

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment