You can download previous versions here and latest version here (ZIP files generated by GitHub on the fly)
- Fixing a crash when using very very long data #57/#59
- Fixing issue #51 regarding a probable race condition when stubs were removed before the request has finished
- Shorten the README.md file and moved all the usage examples in a dedicated wiki page to avoid a endless and frightening README
- The
OHHTTPStubsDescriptor
protocol now inherits from theNSObject
protocol
Fixing issue #47 when stubs were not called, especially when the OHHTTPStubs
pod were loaded both by the application AND the test target/bundle. See also [[A tricky case with Application Tests]].
NSURLSessionConfiguration
's swizzling (to add automatic support ofOHHTTPStubs
toNSURLSession
) is now done in the+load
method of anNSURLSessionConfiguration
category, to be sure it is loaded (and swizzled) only once, even ifOHHTTPStubs
is loaded by two different bundles.- The stubs activation of
NSURLSessionConfiguration
no longer usesobjc_getClass
but uses a call to theOHHTTPStubs
class instead, which ensure that it uses the correctOHHTTPStubs
class in the current bundle instead of always using the one loaded from the main bundle.
- Adding Mac framework & Mac Test Target (#44)
- Adding known limitations in README
- Fixed issue with cookies when
request.URL
isnil
(#39) - Fixed missing
-ObjC
flag in Unit Tests target (that made it unable to call category methods) - Fixed Unit Tests on iOS6 (
NSURLSession
-related Unit Tests now only executed when run on iOS7+ or OSX10.9+, and skipped if targeted for an earlier OS version, asNSURLSession
was not available then)
- Fixed issue with
NSURLSessionConfiguration
auto-swizzling (#37 & #38)
Now
OHHTTPStubs
automagically works withNSURLSessionConfiguration
without the need to enable it for everyNSURLSessionConfiguration
before creating theNSURLSession
: thedefaultSessionConfiguration
andephemeralSessionConfiguration
are now preconfigured automatically to work withOHHTTPStubs
)
- Removed deprecated methods.
The Old API has now totally disappeared, leaving only a clean and simple API without the spam due to old deprecated methods.
Note: If you have already removed the calls to all OHHTTPStubs
deprecated API in your code, you can switch to this 3.0.0
version without any further changes in your code.
- Fixed bug with OHHTTPStubsResponse+JSON when
nil
headers dictionary
- 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.
- 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
Note: version
2.1.0-RC
,2.1.0-rc.1
,2.2.0-RC
and2.2.1-RC
were intermediate Release Candidate versions during the big refactoring and migration to2.2.1
, with the same new features as listed above basicaly, but without the last-minute bugfixes before official release.
- 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!
- Fixed Deadlock introduced by 1.2.1
- Improved thread-safety (#21)
- Stop sending messages to
NSURLProtoclClient
afterstopLoading
This version is buggy as it introduced a deadlock when performing a request on the main thread. 1.2.2 fixes that issue.
- Added support for "HTTP Message Data" stubs generated with
curl -is <someurl>
to replay them easily (#27). See theREADME.md
for more info - Added redirect support for 3xx response codes (#23)
- Dropped non-ARC support. Now
OHHTTPStubs
is to be compiled using ARC. (This should not change anything as it is intended to be integrated using CocoaPods or compiled in a separate xcodeproj anyway)
Easier integration process:
- Use
#import <OHHTTPStubs/OHHTTPStubs.h>
again - But adding the path to the library headers in your application project's
HEADER_SEARCH_PATH
is no longer needed!
- Fixed crash when calling "setEnabled:" / "registerClass:" multiple times
- New integration process: we don't use the
PortableLibrary.xcconfig
anymore (as it generated problems for people using configuration with names other than "Debug" and "Release"). (1)
You will now have to indicate the folder containing headers for OHHTTPStubs
in your HEADER_SEARCH_PATH
Build Settings, and we are back to #import "OHHTTPStubs.h"
until a better solution is found
(1) This modification for the integration process did only last for version 1.1.1. Version 1.1.2 restored
#import <OHHTTPStubs/OHHTTPStubs.h>
(but using a much better solution than the previous xcconfig used) and fillingHEADER_SEARCH_PATH
is no longer needed in further versions. See changelog for 1.1.2 above.
- Added new API
shouldStubRequest:withRequestHandler:
to avoid useless building of stubbed response likeaddRequestHandler:
does
- Adding support for cookies (Set-Cookie headers)
- Added Unit Tests
- Removed calls to the deprecated
dispatch_get_current_queue()
GCD function (was used withdispatch_after
to add fake delay to stubbed responses)
- Fixed #6 : "responseWithError:" released response object too soon
- Fixed small compilation issues #4 (issue in sample code) & #5 (ARC invalid cast)
- Embedded
OHHTTPStubs
in a neat static library for nicer integration in your Xcode4 workspaces.
- Fix issue when used in a SenTestCase
- Cleaning API, added
removeLastHandler
andremoveRequestHandler:
method. - Now first stable API in this version.
- Example project now compatible with ARC and non-ARC environments
- Added Example project
- Added ARC support
- Some fixes
- Initial version