Releases: AliSoftware/OHHTTPStubs
Releases · AliSoftware/OHHTTPStubs
2.3.1
- Fixed bug with OHHTTPStubsResponse+JSON when
nil
headers dictionary
2.3.0 — Naming your stubs + debugging methods
- Added the ability to give a name to a stub, for debugging purposes (property
name
ofid<OHHTTPStubsDescriptor>
) - Added
allStubs
method to list all installed stubs (with their name if they have one, see previous point) - Added
+[OHHTTPStubs onStubActivation:]
method to execute arbitrary code each time a stub is activated. Useful to log which stub is used for each request for example.
2.2.1 — Migrated implementation to NSInputStream
- Complete refactoring to use
NSInputStream
instead of direct use ofNSData
(Thanks to @kcharwood - #28) - Some other code refactoring to split the code in categories and make it clearer
- Some API changes to make
OHHTTPStubs
to fit the new possibility of setting bothrequestTime
andresponseTime
.- Old API is still there but deprecated, and will be removed in next major version
- To convert to the new API, you will mainly simply:
- extract the
responseTime:
parameter to a method call of its own (return [OHHTTPStubsResponse responseWithData:data statusCode:code responseTime:time headers:header];
will becomereturn [[OHHTTPStubsResponse responseWithData:data statusCode:code headers:headers] responseTime:time];
etc.) - convert
responseWithFile:filename
toresponseWithFileAtPath:OHPathForFileInBundle(filename,nil)
- extract the
2.0.0 — Simplified API
- Simplified API
- removed instance methods, no more public
sharedInstance
: directly call class methods on theOHHTTPStubs
class - The old and problematic
addRequestHandler:
method has been deprecated and should not be used anymore. UsestubRequestsPassingTest:withStubResponse:
instead, which is more efficient
- removed instance methods, no more public
- Added API documentation in the headers
- Remove all internal uses of Apple's private APIs
Be careful: if you forgot to remove your use of
OHHTTPStubs
and your stubs from the binary you sent to the AppStore, your app would have been rejected by Apple before 2.0.0, as it was using private API (which was a way to make sure not to forget to remove them), but now it would be accepted silently. So don't forget to remove your stubs andOHHTTPStubs
from your final binary!