An open API service indexing awesome lists of open source software.

https://github.com/lukeredpath/mimiccocoaspecdemo

An example of using the Mimic gem to stub network requests from within an Objective-C test case
https://github.com/lukeredpath/mimiccocoaspecdemo

Last synced: 11 months ago
JSON representation

An example of using the Mimic gem to stub network requests from within an Objective-C test case

Awesome Lists containing this project

README

          

# Testing Objective-C networking code using Mimic

This sample project contains an example of testing HTTP connectivity using [the Mimic gem](https://github.com/lukeredpath/mimic) and it's REST API to configure the stubs.

It uses the [Resty](http://projects.lukeredpath.co.uk/resty) framework for simple, block-based networking and [Kiwi](http://www.kiwi-lib.info/docs.html) and Hamcrest to improve test readability.

## Running the example test

After cloning the project, you'll need to initialize the git submodules to get Kiwi and Hamcrest. You'll also need the bundler gem. Install the Mimic gem from the latest HEAD by running `bundle`.

You should now be able to load Xcode, select the Specs target and build successfully.

Try changing the stubbed response body and see the test fail.