Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Various helper classes to assist when testing for iOS and Mac OS X

branch: develop

This branch is 0 commits ahead and 0 commits behind develop

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.mdown

ILTesting

ILTesting provides a collection of Objective C helper classes primarily for assisting with testing. That is, if you can call the current content of one class a collection.

ILCannedURLProtocol

ILCannedURLProtocol is intended for unit and mock testing of code that makes http requests. It will intercept the standard http protocol and respond with a predefined set of test data every time the test is executed. This way any outside influences can be eliminated from the test results.

In order to use ILCannedURLProtocol, insert the following code in your test case before executing the code under test:

[NSURLProtocol registerClass:[ILCannedURLProtocol class]];
[ILCannedURLProtocol setCannedStatusCode:200];
[ILCannedURLProtocol setCannedHeaders:testHeaders];
[ILCannedURLProtocol setCannedResponseData:testData];

Make sure to unregister the ILCannedURLProtocol after each use:

[NSURLProtocol unregisterClass:[ILCannedURLProtocol class]];

See also:

ILProfilerCompat.c

This file provides a workaround for an error that sometimes occurs when enabling code coverage metrics on iOS using LLVM/Clang and libprofile_rt.dylib:

Detected an attempt to call a symbol in system libraries that is not present on the iPhone: fopen$UNIX2003 called from function llvm_gcda_start_file in image ...

To fix this problem simply include this file in your testing target build.


Feel free to add enhancements, bug fixes, etc. and provide them back to the community!

Thanks,

Claus Broch

Something went wrong with that request. Please try again.