Current Version: 0.1.9.
A 100% pure Swift BDD framework for Mac and Linux.
- runs on Linux and Mac (note: only the open-source Swift is supported, sorry XCode users)
- familiar syntax inspired by RSpec and Jasmine
- natural, readable assertions for most Swift core types
- works with Swift protocols (compatible with objects implementing
- free of dependencies (except LibC)
- before/after suite / spec hooks
- command-line client
- customizable formatters
- multiple formatters
To see all the available assertions and features available, check out the example project.
Swiftest can be installed using the Swift package manager. Add this line to your
Package.swift file to install the latest version.
.Package(url: "https://github.com/bppr/Swiftest.git", Version(0,1,9))
Create a spec target that depends on the module under test. In your
main.swift file of your spec target, register your spec classes.
import Swiftest Swiftest.register([ MyFirstSpec.self, MySecondSpec.self ]) try Swiftest.run()
Once your tests are registered and your runner is configured, you can simply
build your test project (
swift build) and run your tests
Or run a single test
Or run with a different formatter (
"progress" is built in, but it's easy to add
.build/Specs/Specs -l progress
(right now the test-to-filename matching uses
fnmatch under the hood,
and can use many more improvements, but this works for now)
For further instructions on installing and configuring Swiftest, see the wiki page.