{"id":19948439,"url":"https://github.com/akkyie/tablier","last_synced_at":"2025-06-14T20:33:44.930Z","repository":{"id":34979361,"uuid":"189852758","full_name":"akkyie/Tablier","owner":"akkyie","description":"A micro-framework for Table Driven Tests.","archived":false,"fork":false,"pushed_at":"2022-08-16T08:31:42.000Z","size":167,"stargazers_count":35,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-15T00:09:42.486Z","etag":null,"topics":["parametrized-tests","swift","swift-package-manager","table-driven-test","test","testing","unit-testing","xctest"],"latest_commit_sha":null,"homepage":"https://github.com/akkyie/Tablier","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akkyie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-02T13:56:01.000Z","updated_at":"2024-06-07T05:31:16.000Z","dependencies_parsed_at":"2022-08-08T03:15:25.407Z","dependency_job_id":null,"html_url":"https://github.com/akkyie/Tablier","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkyie%2FTablier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkyie%2FTablier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkyie%2FTablier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akkyie%2FTablier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akkyie","download_url":"https://codeload.github.com/akkyie/Tablier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224370118,"owners_count":17299968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parametrized-tests","swift","swift-package-manager","table-driven-test","test","testing","unit-testing","xctest"],"created_at":"2024-11-13T00:40:40.698Z","updated_at":"2024-11-13T00:40:41.325Z","avatar_url":"https://github.com/akkyie.png","language":"Swift","readme":"# Tablier\n\n[![Build Status](https://travis-ci.com/akkyie/Tablier.svg?branch=master)](https://travis-ci.com/akkyie/Tablier)\n[![codecov](https://codecov.io/gh/akkyie/Tablier/branch/master/graph/badge.svg)](https://codecov.io/gh/akkyie/Tablier)\n![Swift 5](https://img.shields.io/badge/swift-5-orange.svg)\n![CocoaPods compatible](https://img.shields.io/cocoapods/v/Tablier.svg)\n![Carthage compatible](https://img.shields.io/badge/carthage-compatible-brightgreen.svg)\n![SPM compatible](https://img.shields.io/badge/SPM-Compatible-brightgreen.svg)\n![Supports iOS, macOS, tvOS and Linux](https://img.shields.io/badge/platform-iOS%20%7C%20macOS%20%7C%20tvOS%20%7C%20linux-lightgrey.svg)\n![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg)\n\nA micro-framework for [_Table Driven Tests_](https://github.com/golang/go/wiki/TableDrivenTests).\n\n![A screenshot to see how it works](https://user-images.githubusercontent.com/1528813/59867231-9b508b00-93c8-11e9-8489-127d441c2a5b.png)\n\n## Features\n\n- ☑️ Dead simple syntax\n- ☑️ Run sync and async tests in parallel\n- ☑️ No additional dependency aside from XCTest\n- ☑️ Use with [Quick](https://github.com/Quick/Quick), or any other XCTest-based testing frameworks\n- ☑️ Fully tested itself\n\n## Installation\n\n### Swift Package Manager\n\n```swift\n.package(url: \"https://github.com/akkyie/Tablier\", from: \u003c#version#\u003e)\n```\n\n### Cocoapods\n\n```ruby\ntarget 'YourTests' do\n    inherit! :search_paths\n    pod 'Tablier'\nend\n```\n\n## Usage\n\n### Synchronous Recipe\n\nYou can define a _test recipe_ to test your classes, structs or functions.\n\n```swift\nfinal class MyParseTests: XCTestCase {\n    func testMyParse() {\n        let recipe = Recipe\u003cString, Int\u003e(sync: { input in\n            // `myParse` here is what you want to test\n            let output: Int = try myParse(input) // it fails if an error is thrown\n            return output\n        })\n...\n```\n\nThen you can list inputs and expected outputs for the recipe, to run the actual test for it.\n\n```swift\n...\n        recipe.assert(with: self) {\n            $0.when(\"1\").expect(1)\n            $0.when(\"1234567890\").expect(1234567890)\n            $0.when(\"-0x42\").expect(-0x42)\n        }\n    }\n}\n```\n\n### Asynchronous Recipe\n\nDefining a recipe with an asynchronous completion is also supported.\n\n```swift\nlet recipe = Recipe\u003cString, Int\u003e(async: { input, complete in\n    myComplexAndSlowParse(input) { (result: Int?, error: Error?) in\n        complete(result, error)\n    }\n})\n```\n\nSince Swift 5.5, you can use `AsyncRecipe` to define asynchronous recipes with async/await syntax:\n\n```swift\nlet recipe = AsyncRecipe\u003cString, Int\u003e { input in\n    try await myComplexAndSlowParse(input)\n}\n```\n\n#### Note\n\n\u003e **Note**\n\u003e\n\u003e 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.\n\u003e Testing errors will be supported in the future.\n\n## Examples\n\n- [SyncExample.swift](/Examples/Tests/ExampleTests/SyncExample.swift): A simple example with a sync function.\n- [AsyncExample.swift](/Examples/Tests/ExampleTests/AsyncExample.swift): An example with an async function.\n- [RxTestExample.swift](/Examples/Tests/ExampleTests/RxTestExample.swift): A more real-world-ish example. Test a view model, with RxSwift and RxTest.\n- [QuickExample.swift](/Examples/Tests/ExampleTests/QuickExample.swift): An example to show Tablier works in a QuickSpec with no hassle.\n\n## License\n\nMIT. See LICENSE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakkyie%2Ftablier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakkyie%2Ftablier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakkyie%2Ftablier/lists"}