Skip to content

Instantly share code, notes, and snippets.

@edwardinubuntu
Created June 23, 2012 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwardinubuntu/2976465 to your computer and use it in GitHub Desktop.
Save edwardinubuntu/2976465 to your computer and use it in GitHub Desktop.
test Load with blocks
- (void)testLoad {
__block BOOL done = NO;
__block ICRecipesModelTests *tempSelf = self;
[_recipesModel loadMore:NO didFinishLoad:^{
done = YES;
STAssertTrue(tempSelf.recipesModel.isLoaded, @"Must be loaded");
STAssertEquals(tempSelf.recipesModel.code, 200, @"HTTP status must be 200");
} loadWithError:^(NSError *error) {
done = YES;
STAssertTrue(NO, @"Load with Error");
}];
while (!done) {
// This executes another run loop.
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
// Sleep 1/100th sec
usleep(1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment