Latest1.1.0
Homepagehttps://github.com/mennolovink/QuickGWT
LicenseMIT
Platformsios 7.0, osx 10.10, tvos 9.0
DependenciesQuick
Authors

Version Platform License

Example

To see the example project, run the following in your terminal:

pod try QuickGWT

Setup

Just add:

import QuickGWT

to the files where you’d like to use given, when and then.

Usage

Considering you’re already using Quick and Nimble:

given("A viewController") {

    var sut: ViewController!

    beforeEach {
        sut = ViewController()
    }

    when("viewDidLoad") {

        beforeEach {
            sut.viewDidLoad()
        }

        then("title is set") {
            expect(sut.title).to(equal("Expected Title"))
        }

        then("backgroundColor is set") {
            expect(sut.view.backgroundColor).to(equal(UIColor.white))
        }
    }
}

The test results will look like this:
Test results

Some background

  • All this lib contains is four functions
    • You can see them here
      • given is an alternative to Quick’s describe function
      • when is an alternative to Quick’s context function
      • and is (also) an alternative to Quick’s context function
      • then is an alternative to Quick’s it function
  • You can always mix up these added functions with Quick’s existing describe, context and it functions

Installation

CocoaPods

QuickGWT is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'QuickGWT'

You’d propably going to want this in your test target(s) only.

Adding the code manually

Considering the meat of this lib is only one file containing 4 functions, you could also just copy over GivenWhenThen.swift to your project/workspace. Don’t forget to make sure the file is part of your test target(s).

Author

mennolovink, [email protected]

License

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

Latest podspec

{
    "name": "QuickGWT",
    "version": "1.1.0",
    "summary": "Simply adds Given When and Then to Quick.",
    "description": "Simply adds Given When and Then to Quick. And makes sure the test outputs are looking pretty.",
    "homepage": "https://github.com/mennolovink/QuickGWT",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "mennolovink": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mennolovink/QuickGWT.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "7.0",
        "osx": "10.10",
        "tvos": "9.0"
    },
    "source_files": "QuickGWT/Classes/**/*",
    "dependencies": {
        "Quick": [
            "~> 1.2"
        ]
    }
}

Pin It on Pinterest

Share This