Latest 1.0.0
Homepage https://github.com/1aurabrown/XCTest-OHHTTPStubSuiteCleanUp
License MIT
Platforms ios 7.0, requires ARC
Dependencies OHHTTPStubs
Frameworks XCTest
Authors

Version
Platform
Build Status

Usage

OHHTTPStubs does not automatically stop stubbing http requests at the end of tests. XCTest+OHHTTPStubSuiteCleanUp will tell OHHHTTPStubs to stop stubbing requests after each XCTest test method is run to avoid stubs from one test leaking into another test. There is no need to #import anything, XCTest+OHHTTPStubSuiteCleanUp cleans up stubs whenever XCTest’s own tearDown method is called (after each test method).

This is useful for ensuring two test contexts don’t mix, but a lot of the time what we want is that all stubs are remved at the end of each test. As we use Specta, XCTest+OHHTTPStubSuiteCleanUp will now also cleanup stubs after every it block.


SpecBegin(Example)

before(^{
  ... setup stubs
});

it(@"does something", ^{
  // check something
});

it(@"does something else", ^{
  // check something else
});

SpecEnd()

In the above example we would clean the stubs 3 times, after the "doessomething"block is finished, after the"doessomething else" block is finished and then finally at the SpecEnd. This is automatically turned on if you are using Specta in CocoaPods.

Requirements

OHHTTPStubs

Installation

XCTest+OHHTTPStubSuiteCleanUp is available through CocoaPods, to install
it simply add the following line to your Podfile:

pod "XCTest+OHHTTPStubSuiteCleanUp"

Author

Laura Brown, [email protected]

License

XCTest+OHHTTPStubSuiteCleanUp is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "XCTest+OHHTTPStubSuiteCleanUp",
    "version": "1.0.0",
    "summary": "Removes all OHHTTP stubs between test suites.",
    "homepage": "https://github.com/1aurabrown/XCTest-OHHTTPStubSuiteCleanUp",
    "license": "MIT",
    "authors": {
        "Laura Brown": "[email protected]"
    },
    "source": {
        "git": "https://github.com/1aurabrown/XCTest-OHHTTPStubSuiteCleanUp.git",
        "tag": "1.0.0"
    },
    "social_media_url": "https://twitter.com/1aurabrown",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Classes",
    "frameworks": "XCTest",
    "dependencies": {
        "OHHTTPStubs": []
    }
}

Pin It on Pinterest

Share This