I am looking for something that uses XCTextExpectation in install or uninstall methods. In Objective-C, it will look something like this:
- (void)setUp { XCTestExpectation *getUserAsyncComplete = [self expectationWithDescription:@"Get Request Attempted and Finished"]; [Connection loginWithEmail:@" some@email.com " onSuccess:^void(^) { [getUserAsyncComplete fulfill]; } onError:nil; [self waitForExpectationsWithTimeout:[self.timeLimit doubleValue] handler:^(NSError *error) { if (error != nil) { XCTFail(@"Failure: user retrieval exceeded %f seconds.", [self.timeLimit doubleValue]); } }]; }
I tried this code and it does not seem to work; or it may be due to the fact that Xcode 6 is still in beta or not supported. Even if there is a solution in Swift, it will be very useful.
source share