Latest 1.0.0
Homepage https://github.com/orta/vigilant
License MIT
Platforms ios 7.0, osx 10.9, tvos 9.0
Dependencies Quick, Nimble
Frameworks Foundation, XCTest
Authors

be Vigilant

Concept

It’s great that you can run both Quick and Nimble separately, however that does come with a downside. One of Rspec’s great features that helps me catch bugs in my tests is that it will raise an error if a test does not run any expectations.

This Pod bridges Quick and Nimble, and creates a contract between the two. which enforces that you will use Nimble matchers inside every Quick test.

The code is short, well commented, but a little bit esoteric. You’d probably enjoy reading it.

Examples

Here’s a test suite with two tests:

import Quick
import Nimble

class VigilentSpec: QuickSpec {
    override func spec() {

        it("This test will pass") {

        }

        it("This should pass too") {
            expect("Tests") == "Tests"
        }
    }
}

Simply by including the Pod "Vigilant" in your Podfile, you will see a message like this in your console:

Test Case '-[Vigilant_Tests.VigilentSpec This_test_will_pass]' started.
2016-04-10 16:07:29.026 Vigilant_Example[20344:1112445] 

Vigilent: Did not see any `expect`s in the test: 'This test will pass'

Test Case '-[Vigilant_Tests.VigilentSpec This_test_will_pass]' passed (0.013 seconds).

Making it easy to see what tests are running without any expects being called.

Hard mode

Maybe you want to go all out and enforce that every test have expectations, well, this Pod
also provides a way to do that. In your Testing AppDelegate, call the Vigilent class’s function
startExpecting to cause assertions instead of logs.

Usage

To run the example project, run pod try Vigilant.

Installation

Vigilant is available through CocoaPods. To install
it, simply add the following line to your Podfile in a test target:

pod "Vigilant"

Once SwiftPM becomes useful I’ll look into supporting that too.

Author

Orta Therox, [email protected]

License

Vigilant is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Vigilant",
    "version": "1.0.0",
    "summary": "Glues Quick & Nimble together. Makes sure you run an expectation on every test.",
    "description": "Be Quick, be Nimble, be Vigilent. Vigilent keeps track of whether any testnruns it's expectations. This makes it easier to notice when you have async codenwhich "passes" because the expectations are not ran during the test.",
    "platforms": {
        "ios": "7.0",
        "osx": "10.9",
        "tvos": "9.0"
    },
    "homepage": "https://github.com/orta/vigilant",
    "license": "MIT",
    "authors": {
        "Orta Therox": "[email protected]"
    },
    "source": {
        "git": "https://github.com/orta/vigilant.git",
        "tag": "1.0.0"
    },
    "social_media_url": "https://twitter.com/orta",
    "source_files": "Vigilent/Classes/**/*",
    "frameworks": [
        "Foundation",
        "XCTest"
    ],
    "dependencies": {
        "Quick": [],
        "Nimble": []
    }
}

Pin It on Pinterest

Share This