How to test async method in block using OCMock
问题 I can't seem to figure out how to test this method: - (void)writer:(id)writer didFailWithError:(NSError *)error; { [self.alertView dismissWithClickedButtonIndex:0 animated:YES]; void (^alertViewBlock)(int) = ^(int buttonIndex) { if (buttonIndex == 1) { [self performSelectorOnMainThread:@selector(savePostponeReasonsAsynchronously) withObject:nil waitUntilDone:NO]; } else { NSLog(@"dismissed"); self.savePostponeReasonsQueue = nil; } }; [self showPostponeReasonFailedAlert:alertViewBlock]; }