Skip to content

kylef-archive/spectre-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages