Skip to content

Instantly share code, notes, and snippets.

@davertay
Created April 28, 2014 04:59
Show Gist options
  • Save davertay/11362152 to your computer and use it in GitHub Desktop.
Save davertay/11362152 to your computer and use it in GitHub Desktop.
id mockTaskVC = [OCMockObject partialMockForObject:taskVC];
[[mockTaskVC expect] showToastMessage:@"Task Started" completion:OCMOCK_ANY];
[[[mockTaskVC reject] ignoringNonObjectArgs] displayAlertWithMsg:OCMOCK_ANY title:OCMOCK_ANY tag:-1];
[taskVC toggleStartPauseResume:nil];
// Idle the run loop until the background task is finished
[self.client waitForAllOperations];
NSTimeInterval delay = 2.0;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[mockTaskVC verify];
NOTIFY_TESTS_DONE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment