BDD Framework for Swift
describe("a person") {
let person = Person(name: "Kyle")
$0.it("has a name") {
try equal(person.name, "Kyle")
}
$0.it("returns the name as description") {
try equal(person.description, "Kyle")
}
}
Assert two types are equal.
try equal(name, "Kyle")
Assert two types are not equal.
try notEqual(name, "Kyle")
try fail("Everything is broken.")
You can easily provide your own assertions, you just need to call fail
on
a failure.
Spectre currently has one standard reporter. There is an API to build your own
if you would like to. Just create a type that conforms to Reporter
and pass
it to the run
function.
Spectre is currently only supported by the Conche build system. Simply add a test_spec
to your Conche podspec depending on Spectre and it will run your tests with conche test
.