An Rspec Inspired Behavior Driven Testing Framework For Swift

About a month ago I mentioned a nice utility library for Swift inspired by Underscore.js and Asterism.

Here’s an extensive testing framework for Swift (and Objective-C) with a syntax inspired by Rspec, Specta and Gingko called Quick from Brian Gesiak.

This example from the readme shows the syntax of Quick in action:

import Quick
import Nimble

class TableOfContentsSpec: QuickSpec {
    override func spec() {
        describe("the table of contents below") {
            it("has everything you need to get started") {
                let sections = TableOfContents().sections
                expect(sections).to.contain("Quick Core")
                expect(sections).to.contain("Quick Expectations")
                expect(sections).to.contain("How to Install Quick")
            }

<pre><code>        context("if it doesn’t have what you’re looking for") {
            it("needs to be updated") {
                let you = You(awesome: true)
                expect{you.submittedAnIssue}.will.beTrue()
            }
        }
    }
}
</code></pre>

}

You can find Quick on Github here.

A very nice behavior driven testing framework.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: An Rspec Inspired Behavior Driven Testing Framework For Swift

©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *