Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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