Skip to content

Instantly share code, notes, and snippets.

@ivan3bx
Created March 10, 2010 07:11
Show Gist options
  • Save ivan3bx/327614 to your computer and use it in GitHub Desktop.
Save ivan3bx/327614 to your computer and use it in GitHub Desktop.
Stubbing HTTP status code with OCMock
NSInteger result = 401;
const void *val = &result;
id mockResponse = [OCMockObject mockForClass:[NSHTTPURLResponse class]];
[[[mockResponse stub] andReturn:[NSValue value:val withObjCType:@encode(NSInteger)]] statusCode];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment