Created
March 19, 2013 13:49
-
-
Save halsk/5196244 to your computer and use it in GitHub Desktop.
Kiwi で非同期テストを行う ref: http://qiita.com/items/38b66294e5c0bc46d214
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
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