Created
June 14, 2013 12:56
-
-
Save tibr/5781595 to your computer and use it in GitHub Desktop.
stub context example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context(@"success", ^{ | |
beforeEach(^{ | |
[OHHTTPStubs shouldStubRequestsPassingTest:^BOOL(NSURLRequest *request) { | |
NSString *expectedPath = @"/3/configuration"; | |
BOOL shouldStub = [[request.URL path] isEqualToString:expectedPath]; | |
return shouldStub; | |
} withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) { | |
OHHTTPStubsResponse *response = [OHHTTPStubsResponse responseWithFile:@"configuration.json" | |
contentType:@"application/json" | |
responseTime:0.0]; | |
return response; | |
}]; | |
}); | |
it(@"should parse something", ^{ | |
}); | |
it(@"should do something else", ^{ | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment