Skip to content
Powerful Objective-C library to replay HTTP responses
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CCLRequestReplay
Tests
.gitignore
.travis.yml
CCLRequestReplay.podspec
LICENSE
Makefile
README.md

README.md

CCLRequestReplay

Build Status

CCLRequestReplay is greatly inspired by VCRURLConnection, however it supports creating a recording purely from code instead of having to actually record the requests manually and store them in a json file. It also supports using API Blueprint's directly so you can write your iOS and OS X tests directly to your API specification without writing any extra code.

Usage

Recording

CCLRequestReplayManager *manager = [[CCLRequestReplayManager alloc] init];
[manager record];

/* Make an NSURLConnection */

[manager stopRecording];

Re-playing

[manager replay];

/* Make an NSURLConnection, it will be served from the manager */

[manager stopReplay];

API Blueprint

To use CCLRequestReplay with API Blueprint, first you will need to convert your API Blueprint file from Markdown to JSON. This process can be done with Snow Crash. Once installed, the conversion can be done by invoking it with your Markdown file as follows.

$ snowcrash -o PalaverTests/Fixtures/palaver.apib.json -f json palaver-api-docs/palaver.apib

Then simple add your JSON file to your bundle so you can pull it out in your tests using the following:

NSURL *blueprintURL = [[NSBundle mainBundle] URLForResource:@"fitnessfirst.apib" withExtension:@"json"];
CCLRequestReplayManager *replayManager = [CCLRequestReplayManager managerFromBlueprintURL:blueprintURL error:nil];
[replayManager replay];

Be sure to keep the manager alive across all your tests that need it.

Installation

Installation is simple, add the following to your Podfile:

pod 'CCLRequestReplay', :git => 'https://github.com/cocodelabs/CCLRequestReplay'

License

CCLRequestReplay is released under the BSD license. See LICENSE.

You can’t perform that action at this time.