Skip to content

Commit

Permalink
Fixed some header doc
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSoftware committed Jun 30, 2013
1 parent 559f8fb commit 825d2ba
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
7 changes: 5 additions & 2 deletions OHHTTPStubs/OHHTTPStubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ typedef id OHHTTPStubsRequestHandlerID;
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Interface

/*! @header OHHTTPStubs
Stubs Manager. Use this class to add and remove stubs and stub your network requests.
*/
@interface OHHTTPStubs : NSObject

////////////////////////////////////////////////////////////////////////////////
Expand All @@ -54,8 +57,8 @@ typedef id OHHTTPStubsRequestHandlerID;

/*! Add a request handler to the stubs list
@param handler The request handler block to add to the stubs list. This block takes as parameters:
* a NSURLRequest for which the stub is called, to determine the appropriate response to return
* a boolean as a parameter to tell if this block is only called for checking we want to stub or not (in this case, you should return quickly)
- a NSURLRequest for which the stub is called, to determine the appropriate response to return
- a boolean as a parameter to tell if this block is only called for checking we want to stub or not (in this case, you should return quickly)
or for the actual stubbing (in this case you should return the actual OHHTTPStubsResponse to use)
@return an opaque object that uniquely identifies the handler and can be later used to remove it with removeRequestHandler:
@note This method is deprecated: use `shouldStubRequestsPassingTest:withStubResponse:` instead
Expand Down
2 changes: 1 addition & 1 deletion OHHTTPStubs/OHHTTPStubs.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ +(id)shouldStubRequestsPassingTest:(OHHTTPStubsTestBlock)shouldReturnStubForRequ
BOOL shouldStub = shouldReturnStubForRequest ? shouldReturnStubForRequest(request) : YES;
if (onlyCheck)
{
return shouldStub ? OHHTTPStubsResponseUseStub : OHHTTPStubsResponseDontUseStub;
return shouldStub ? (OHHTTPStubsResponse*)@"DummyStub" : (OHHTTPStubsResponse*)nil;
}
else
{
Expand Down
15 changes: 8 additions & 7 deletions OHHTTPStubs/OHHTTPStubsResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Defines & Constants

#define OHHTTPStubsResponseUseStub (OHHTTPStubsResponse*)@"DummyStub"
#define OHHTTPStubsResponseDontUseStub (OHHTTPStubsResponse*)nil

// Standard download speeds.
extern const double
OHHTTPStubsDownloadSpeedGPRS,
Expand All @@ -46,6 +43,10 @@ OHHTTPStubsDownloadSpeedWifi;
////////////////////////////////////////////////////////////////////////////////
#pragma mark - Interface

/*! @header
Stubs Response. This describes a stubbed response to be returned by the URL Loading System, including its
HTTP headers, body, statusCode and response time.
*/
@interface OHHTTPStubsResponse : NSObject

////////////////////////////////////////////////////////////////////////////////
Expand All @@ -67,7 +68,7 @@ OHHTTPStubsDownloadSpeedWifi;
@param data The raw data to return in the response
@param statusCode the HTTP Status Code to use in the response
@param responseTime the time to wait before the response is sent (to simulate slow networks for example)
@param headers The HTTP Headers to return in the response
@param httpHeaders The HTTP Headers to return in the response
@return an OHHTTPStubsResponse describing the corresponding response to return by the stub
*/
+(instancetype)responseWithData:(NSData*)data
Expand All @@ -79,7 +80,7 @@ OHHTTPStubsDownloadSpeedWifi;
@param fileName The file name and extension that contains the response body to return. The file must be in the application bundle
@param statusCode the HTTP Status Code to use in the response
@param responseTime the time to wait before the response is sent (to simulate slow networks for example)
@param headers The HTTP Headers to return in the response
@param httpHeaders The HTTP Headers to return in the response
@return an OHHTTPStubsResponse describing the corresponding response to return by the stub
*/
+(instancetype)responseWithFile:(NSString*)fileName
Expand All @@ -98,7 +99,7 @@ OHHTTPStubsDownloadSpeedWifi;
contentType:(NSString*)contentType
responseTime:(NSTimeInterval)responseTime;

/*! Builds a response given a message data as returned by `curl -is <url>`, that is containing both the headers and the body.
/*! Builds a response given a message data as returned by `curl -is [url]`, that is containing both the headers and the body.
This method will split the headers and the body and build a OHHTTPStubsReponse accordingly
@param responseData the NSData containing the whole HTTP response, including the headers and the body
@param responseTime the time to wait before the response is sent (to simulate slow networks for example)
Expand Down Expand Up @@ -133,7 +134,7 @@ OHHTTPStubsDownloadSpeedWifi;
@param data The raw data to return in the response
@param statusCode the HTTP Status Code to use in the response
@param responseTime the time to wait before the response is sent (to simulate slow networks for example)
@param headers The HTTP Headers to return in the response
@param httpHeaders The HTTP Headers to return in the response
@return an OHHTTPStubsResponse describing the corresponding response to return by the stub
*/
-(instancetype)initWithData:(NSData*)data
Expand Down

0 comments on commit 825d2ba

Please sign in to comment.