Skip to content

Commit

Permalink
Merge branch 'master' of github.com:AFNetworking/AFNetworking
Browse files Browse the repository at this point in the history
  • Loading branch information
mattt committed Aug 11, 2013
2 parents 748260a + 95a51a4 commit 786b1ef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -17,4 +17,5 @@ profile
DerivedData
.idea/
Tests/Pods
Tests/Podfile.lock
Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes/
5 changes: 5 additions & 0 deletions AFNetworking/AFURLConnectionOperation.m
Expand Up @@ -528,6 +528,11 @@ - (void)operationDidStart {
});

if ([self isCancelled]) {
NSDictionary *userInfo = nil;
if ([self.request URL]) {
userInfo = [NSDictionary dictionaryWithObject:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
}
self.error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo];
[self finish];
}
}
Expand Down
2 changes: 2 additions & 0 deletions Tests/AFHTTPRequestOperationTests.m
Expand Up @@ -76,6 +76,8 @@ - (void)testThatCancellationOfRequestOperationSetsError {
}

- (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock {
[Expecta setAsynchronousTestTimeout:10.0];

__block NSError *blockError = nil;

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];
Expand Down
24 changes: 0 additions & 24 deletions Tests/Podfile.lock

This file was deleted.

0 comments on commit 786b1ef

Please sign in to comment.