Skip to content

Releases: AliSoftware/OHHTTPStubs

2.3.1

17 Oct 22:08
Compare
Choose a tag to compare
  • Fixed bug with OHHTTPStubsResponse+JSON when nil headers dictionary

2.3.0 — Naming your stubs + debugging methods

17 Oct 22:09
Compare
Choose a tag to compare
  • Added the ability to give a name to a stub, for debugging purposes (property name of id<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

17 Oct 22:10
Compare
Choose a tag to compare
  • Complete refactoring to use NSInputStream instead of direct use of NSData (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 both requestTime and responseTime.
    • 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 become return [[OHHTTPStubsResponse responseWithData:data statusCode:code headers:headers] responseTime:time]; etc.)
      • convert responseWithFile:filename to responseWithFileAtPath:OHPathForFileInBundle(filename,nil)

2.0.0 — Simplified API

17 Oct 22:11
Compare
Choose a tag to compare
  • Simplified API
    • removed instance methods, no more public sharedInstance: directly call class methods on the OHHTTPStubs class
    • The old and problematic addRequestHandler: method has been deprecated and should not be used anymore. Use stubRequestsPassingTest:withStubResponse: instead, which is more efficient
  • 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 and OHHTTPStubs from your final binary!