Skip to content
Command line tool to build and run tests written using the Spectre Swift BDD testing framework
Branch: master
Clone or download
Pull request Compare This branch is 4 commits behind kylef-archive:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Sources
.swift-version
LICENSE
Package.swift
README.md

README.md

spectre-build

Command line tool to build and run tests written using the Spectre Swift BDD testing framework.

Usage

Add the spectre-build dependency to your SPM test dependencies in Package.swift:

import PackageDescription

let package = Package(
  name: "Person",
  testDependencies: [
    .Package(url: "https://github.com/kylef/spectre-build.git", majorVersion: 0),
  ]
)

Test Files

Create some tests, and place them into the "Tests" directory:

Tests/HTTPParserSpec.swift
import Spectre
import Person

func describePerson() {
  describe("a person") {
    let person = Person(name: "Kyle")

    $0.it("has a name") {
      try expect(person.name) == "Kyle"
    }

    $0.it("returns the name as description") {
      try expect(person.description) == "Kyle"
    }
  }
}
Tests/main.swift
describePerson()

Build & Run

Then simply build and run your tests:

$ swift build
$ .build/debug/spectre-build
-> a person
  -> has a name
  -> returns the name as description

2 passes and 0 failures
You can’t perform that action at this time.