Skip to content

Instantly share code, notes, and snippets.

@halsk
Created March 19, 2013 13:49
Show Gist options
  • Save halsk/5196244 to your computer and use it in GitHub Desktop.
Save halsk/5196244 to your computer and use it in GitHub Desktop.
Kiwi で非同期テストを行う ref: http://qiita.com/items/38b66294e5c0bc46d214
SPEC_BEGIN(PropertyUtil)
describe(@"SimpleRemoteObject", ^{
context(@"read timeout", ^{
beforeAll(^{
[SRRemoteConfig defaultConfig].baseurl = @"http://localhost:2000/";
[SRRemoteConfig defaultConfig].timeout = 2;
});
it(@"should timeout with specified second", ^{
__block NSError *ret;
[TimeoutObj fetchAsync:^(NSArray *allRemote, NSError *error) {
ret = error;
}];
[[expectFutureValue(ret) shouldEventuallyBeforeTimingOutAfter(3.0)] beNonNil];
[[expectFutureValue(ret.localizedDescription) shouldEventuallyBeforeTimingOutAfter(3.0)] equal:@"The request timed out."];
});
});
});
SPEC_END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment