Skip to content

Commit

Permalink
Merge pull request #67 from 8W9aG/add-cancel-test
Browse files Browse the repository at this point in the history
Add testCancelledError
  • Loading branch information
8W9aG committed Jan 30, 2016
2 parents bae6ea6 + 21c6b53 commit d34985a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions SPTDataLoaderTests/SPTDataLoaderRequestTaskHandlerTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,12 @@ - (void)testDataAppendedWhenNotStreaming
XCTAssertEqualObjects([dataString stringByAppendingString:dataString], receivedString);
}

- (void)testCancelledError
{
NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:nil];
[self.handler receiveResponse:nil];
[self.handler completeWithError:error];
XCTAssertEqual(self.requestResponseHandler.numberOfCancelledRequestCalls, 1u, @"The handler did not relay the failed response onto its request response handler");
}

@end

0 comments on commit d34985a

Please sign in to comment.