All Projects → akkyie → Tablier

akkyie / Tablier

Licence: MIT license
A micro-framework for Table Driven Tests.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to Tablier

Hippolyte
HTTP Stubbing in Swift
Stars: ✭ 109 (+230.3%)
Mutual labels:  test, swift-package-manager, xctest
Django Jenkins
Plug and play continuous integration with django and jenkins
Stars: ✭ 933 (+2727.27%)
Mutual labels:  unit-testing, test
Xctesthtmlreport
Xcode-like HTML report for Unit and UI Tests
Stars: ✭ 489 (+1381.82%)
Mutual labels:  unit-testing, xctest
testza
Full-featured test framework for Go! Assertions, fuzzing, input testing, output capturing, and much more! 🍕
Stars: ✭ 409 (+1139.39%)
Mutual labels:  unit-testing, test
Goreporter
A Golang tool that does static analysis, unit testing, code review and generate code quality report.
Stars: ✭ 2,943 (+8818.18%)
Mutual labels:  unit-testing, test
Mockingbird
A convenient mocking framework for Swift
Stars: ✭ 302 (+815.15%)
Mutual labels:  unit-testing, xctest
Atoum
The modern, simple and intuitive PHP unit testing framework.
Stars: ✭ 1,382 (+4087.88%)
Mutual labels:  unit-testing, test
got
An enjoyable golang test framework.
Stars: ✭ 234 (+609.09%)
Mutual labels:  unit-testing, test
Bookstore Ios
 Sample iOS App - A collection of examples and patterns for Unit Testing, UI Testing, handling Result/Optionals, writing documentation, and more. Details in README.
Stars: ✭ 147 (+345.45%)
Mutual labels:  unit-testing, xctest
Snap Shot
Jest-like snapshot feature for the rest of us, works magically by finding the right caller function
Stars: ✭ 170 (+415.15%)
Mutual labels:  unit-testing, test
Mocktopus
Mocking framework for Rust
Stars: ✭ 179 (+442.42%)
Mutual labels:  unit-testing, test
XCTestHTMLReport
Xcode-like HTML report for Unit and UI Tests
Stars: ✭ 581 (+1660.61%)
Mutual labels:  unit-testing, xctest
teuton
Infrastructure test, mainly useful for sysadmin teachers and making contests
Stars: ✭ 22 (-33.33%)
Mutual labels:  unit-testing, test
Bach
Bach Testing Framework
Stars: ✭ 392 (+1087.88%)
Mutual labels:  unit-testing, test
Wasmite
Now WebAssembly has proper testing, unit-testing and debugging 🤗
Stars: ✭ 20 (-39.39%)
Mutual labels:  unit-testing, test
Capture Stream
Capture stream output.
Stars: ✭ 10 (-69.7%)
Mutual labels:  unit-testing, test
Quiz App
A repository reflecting the progress made on the "How to Build iOS Apps with Swift, TDD & Clean Architecture" YouTube series, by Caio & Mike.
Stars: ✭ 230 (+596.97%)
Mutual labels:  unit-testing, xctest
emacs-python-pytest
run pytest inside emacs
Stars: ✭ 105 (+218.18%)
Mutual labels:  unit-testing, test
unittest expander
A library that provides flexible and easy-to-use tools to parameterize Python unit tests, especially those based on unittest.TestCase.
Stars: ✭ 12 (-63.64%)
Mutual labels:  unit-testing, test
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+32342.42%)
Mutual labels:  unit-testing, swift-package-manager

Tablier

Build Status codecov Swift 5 CocoaPods compatible Carthage compatible SPM compatible Supports iOS, macOS, tvOS and Linux MIT License

A micro-framework for Table Driven Tests.

A screenshot to see how it works

Features

  • ☑️ Dead simple syntax
  • ☑️ Run sync and async tests in parallel
  • ☑️ No additional dependency aside from XCTest
  • ☑️ Use with Quick, or any other XCTest-based testing frameworks
  • ☑️ Fully tested itself

Installation

Swift Package Manager

.package(url: "https://github.com/akkyie/Tablier", from: <#version#>)

Cocoapods

target 'YourTests' do
    inherit! :search_paths
    pod 'Tablier'
end

Usage

Synchronous Recipe

You can define a test recipe to test your classes, structs or functions.

final class MyParseTests: XCTestCase {
    func testMyParse() {
        let recipe = Recipe<String, Int>(sync: { input in
            // `myParse` here is what you want to test
            let output: Int = try myParse(input) // it fails if an error is thrown
            return output
        })
...

Then you can list inputs and expected outputs for the recipe, to run the actual test for it.

...
        recipe.assert(with: self) {
            $0.when("1").expect(1)
            $0.when("1234567890").expect(1234567890)
            $0.when("-0x42").expect(-0x42)
        }
    }
}

Asynchronous Recipe

Defining a recipe with an asynchronous completion is also supported.

let recipe = Recipe<String, Int>(async: { input, complete in
    myComplexAndSlowParse(input) { (result: Int?, error: Error?) in
        complete(result, error)
    }
})

Since Swift 5.5, you can use AsyncRecipe to define asynchronous recipes with async/await syntax:

let recipe = AsyncRecipe<String, Int> { input in
    try await myComplexAndSlowParse(input)
}

Note

Note

When an error is thrown in the sync initalizer or the completion handler is called with an error, the test case is considered as failed for now. Testing errors will be supported in the future.

Examples

License

MIT. See LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].