Created
June 23, 2012 02:52
-
-
Save edwardinubuntu/2976465 to your computer and use it in GitHub Desktop.
test Load with blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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