Browse files

Rework intermittently failing tests

  • Loading branch information...
1 parent 185874d commit e051c63e55f05ba74c423c4638b8dde3c0c10467 @blakewatters blakewatters committed May 17, 2012
Showing with 7 additions and 7 deletions.
  1. +5 −2 Tests/Logic/Network/RKClientTest.m
  2. +2 −5 Tests/Logic/Network/RKRequestTest.m
View
7 Tests/Logic/Network/RKClientTest.m
@@ -37,18 +37,21 @@ - (void)tearDown {
}
- (void)testShouldDetectNetworkStatusWithAHostname {
- RKClient* client = [RKClient clientWithBaseURLString:@"http://restkit.org"];
+ RKClient* client = [[RKClient alloc] initWithBaseURLString:@"http://restkit.org"];
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.3]]; // Let the runloop cycle
RKReachabilityNetworkStatus status = [client.reachabilityObserver networkStatus];
assertThatInt(status, is(equalToInt(RKReachabilityReachableViaWiFi)));
+ [client release];
}
- (void)testShouldDetectNetworkStatusWithAnIPAddressBaseName {
- RKClient* client = [RKClient clientWithBaseURLString:@"http://173.45.234.197"];
+ RKClient *client = [[RKClient alloc] initWithBaseURLString:@"http://173.45.234.197"];
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.3]]; // Let the runloop cycle
RKReachabilityNetworkStatus status = [client.reachabilityObserver networkStatus];
assertThatInt(status, isNot(equalToInt(RKReachabilityIndeterminate)));
+ [client release];
}
+
- (void)testShouldSetTheCachePolicyOfTheRequest {
RKClient* client = [RKClient clientWithBaseURLString:@"http://restkit.org"];
client.cachePolicy = RKRequestCachePolicyLoadIfOffline;
View
7 Tests/Logic/Network/RKRequestTest.m
@@ -721,13 +721,10 @@ - (void)testShouldNotRaiseAnExceptionWhenAttemptingToMutateResourcePathOnAnNSURL
- (void)testShouldOptionallySkipSSLValidation {
NSURL *URL = [NSURL URLWithString:@"https://blakewatters.com/"];
- RKTestResponseLoader *loader = [RKTestResponseLoader responseLoader];
RKRequest *request = [RKRequest requestWithURL:URL];
- request.delegate = loader;
request.disableCertificateValidation = YES;
- [request sendAsynchronously];
- [loader waitForResponse];
- assertThatBool([loader.response isOK], is(equalToBool(YES)));
+ RKResponse *response = [request sendSynchronously];
+ assertThatBool([response isOK], is(equalToBool(YES)));
}
- (void)testShouldNotAddANonZeroContentLengthHeaderIfParamsIsSetAndThisIsAGETRequest {

0 comments on commit e051c63

Please sign in to comment.