Skip to content

Instantly share code, notes, and snippets.

@danielpunkass
Created March 20, 2009 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpunkass/82597 to your computer and use it in GitHub Desktop.
Save danielpunkass/82597 to your computer and use it in GitHub Desktop.
- (void) testSimpleHTTPRequest
{
RSHTTPRequest* testViaGoogleRequest = [[RSHTTPRequest alloc] initWithURL:[self serverURLForHTTPTestNamed:@"SimpleHTTPRequest"] notifyingDelegate:self];
STAssertNotNil(testViaGoogleRequest, @"Creation of HTTP Request should have succeeded.");
[testViaGoogleRequest download];
[self spinRunLoopUntilCompletionOrTimeout];
STAssertTrue([[testViaGoogleRequest responseData] isEqualTo:[@"<hello>" dataUsingEncoding:NSUTF8StringEncoding]], @"Expected <hello> result, got %@.", [testViaGoogleRequest responseData]);
[testViaGoogleRequest release];
}
- (GTMHTTPResponseMessage *) responseForTestRequest_SimpleHTTPRequest:(GTMHTTPRequestMessage *)request
{
return [GTMHTTPResponseMessage responseWithHTMLString:@"<hello>"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment