Latest 1.0.0
Homepage https://github.com/unsignedintellects/GreatExpectations
License MIT
Platforms ios 9.0, osx 10.9
Frameworks XCTest
Authors

in2plane
GreatExpectations
Swift Package Manager


Twitter: @unsignedints

A wrapper around XCTestCase that makes working with XCTestExpectations much cleaner

Overview

Turn this:

let exp = expectation(description: #function)

AsyncTask {
    exp.fulfill()
}

waitForExpectations(timeout: 5)

Into this:

expect { expectation in
    AsyncTask {
        expectation.fulfill()
    }
}

It may not look like much of an improvement, but it allows async unit tests to be written without having to explicitly declare an instance of XCTestExpectation and then declaring for how long to wait for.

The method signature defaults the expectation name to be #function for clarity with a timeout of 5 seconds. Both of these can be overidden:

expect("Test Name", limitingTo: 3.0) { expectation in
    // Perform async task
}

Latest podspec

{
    "name": "GreatExpectations",
    "version": "1.0.0",
    "summary": "A wrapper around XCTestCase that makes working with XCTestExpectations much cleaner",
    "description": "A lightweight wrapper on XCTestCase that removes some of the repetitive boilerplate associated with async unit tests",
    "homepage": "https://github.com/unsignedintellects/GreatExpectations",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Jack Rostron": "[email protected]"
    },
    "source": {
        "git": "https://github.com/unsignedintellects/GreatExpectations.git",
        "tag": "1.0.0"
    },
    "source_files": "Sources/GreatExpectations/*.swift",
    "frameworks": "XCTest",
    "swift_version": "4.2",
    "platforms": {
        "ios": "9.0",
        "osx": "10.9"
    }
}

Pin It on Pinterest

Share This