Latest 0.2.2
Homepage https://github.com/vknabel/Taps
License MIT
Platforms ios 8.0, osx 10.10, watchos 2.0, tvos 9.0
Dependencies RxSwift, RxBlocking, TestHarness
Authors

Swift 3
GitHub release
SwiftPM compatible
Plaforms
Build Status
GitHub license

Taps is a lightweight Unit Test library optimized for asynchronous code.
It has been implemented using RxSwift and therefore you can easily test your own Observables with ease,
but no RxSwift knowledge is needed.

As the generated output is TAP13 compatible, you can easily customize it yourself.
You can either use Taps integrated TapsHarness or you can use the pod TestHarness to customize the output.

You’ll find the autogenerated docs here.

Example

Taps assumes all tests to be concurrent. That said it is quite easy to run them:

taps.test("test async completion", timeout: 0.1) { t in
  DispatchQueue.global().async {
    t.pass()
    t.end() // this terminates the test
  }
}

But instead of always being forced to call the t.end() when testing synchronous code,
you can add a plan for all expected tests.

taps.test("test does not throw on return", plan: 1) { t in
  t.doesThrow("does throw is ok when throwing") {
    return 1
  }
}

Since Taps uses RxSwift under the hood it really shines, when it comes to testing Observables.
If your tested Observable completes, the test will automatically be finished!

tape.test("just emits", timeout: 0.01) { t in
  Observable.just(3)
    .map { $0 + 1 }
    .test(
      onNext: t.notEqual(to: 3, "just emits 3"),
      onError: t.fail(with: "just won't throw'")
    )
}

License

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

Latest podspec

{
    "name": "Taps",
    "version": "0.2.2",
    "summary": "Taps is a lightweight Unit Test library optimized for asynchronous code and generating TAP13 compatible output.",
    "description": "Taps is a lightweight Unit Test library optimized for asynchronous code.n  * As the generated output is TAP13 compatible, you can easily customize it yourself.n  * Taps has been implemented using RxSwift and therefore you can easily test your own Observables with ease.n  * You can either use Taps integrated TapsHarness or you can use the pod TestHarness to customize the output.",
    "homepage": "https://github.com/vknabel/Taps",
    "documentation_url": "https://vknabel.github.io/Taps",
    "license": "MIT",
    "authors": {
        "Valentin Knabel": "[email protected]"
    },
    "social_media_url": "https://twitter.com/vknabel",
    "source": {
        "git": "https://github.com/vknabel/Taps.git",
        "tag": "0.2.2"
    },
    "source_files": "Sources/Taps/**/*.swift",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    },
    "dependencies": {
        "RxSwift": [
            "~>3.0"
        ],
        "RxBlocking": [
            "~>3.0"
        ],
        "TestHarness": [
            "0.0.1"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This