Taps

public final class Taps: OfferingTaps

This is the entry point for all of your tests. Declare a function that takes Tape and write your tests! In order to see how to test in detail see Test.

func describeYourTestSubject(taps: Taps) {
  taps.test("test property") { (t: Test)
    // Test property in here...
    t.end()
  }

  // more tests here...
}

// Starting tests
Tape.runMain(tests: [
  describeYourTestSubject
])

If you want to test Observables, use RxTaps.

  • Creates a cold Taps instance using a TapsHarness, that won’t start running Tests by default.

    Parameter

    Parameter harness: The TapsHarness that shall be used. Uses TapHarness.printHarness by default.

    Declaration

    Swift

    public init(harness: TapsHarness? = nil)

    Parameters

    harness

    The TapsHarness that shall be used. Uses TapHarness.printHarness by default.

  • Returns an observable running all tests. Only emits one single or an error.

    Declaration

    Swift

    public var runner: Observable<TestCount>
  • Starts to execute all Tests for the current Taps. All tests will be interrupted on dispose.

    Declaration

    Swift

    public func start() -> Disposable
  • Starts to execute all Tests for the current Taps. All tests run until all are finished.

    Declaration

    Swift

    public func run()
  • Starts to execute all Tests for the current Taps. Thereafter, there won’t be executed anything. Exits with 1 if there were errors.

    Declaration

    Swift

    public func runMain() -> Never
  • Declaration

    Swift

    public var testCaseObserver: AnyObserver<TestCase>
  • Creates a cold Taps, that executes all given Tests. Uses the print harness TapHarness.printHarness.

    Parameter

    Parameter harness: The harness, that interprets the output.

    Parameter

    Parameter tests: All tests to be executed.

    Declaration

    Swift

    public static func with(_ harness: TapsHarness? = nil, tests: [(Taps) -> Void]) -> Taps

    Parameters

    harness

    The harness, that interprets the output.

    tests

    All tests to be executed.

  • Creates a cold Observable, that executes all given Tests. Uses the print harness TapHarness.printHarness.

    Parameter

    Parameter harness: The harness, that interprets the output.

    Parameter

    Parameter tests: All tests to be executed.

    Declaration

    Swift

    public static func runner(
        with harness: TapsHarness? = nil,
        testing tests: [(Taps) -> Void]
      ) -> Observable<TestCount>

    Parameters

    harness

    The harness, that interprets the output.

    tests

    All tests to be executed.

  • Creates a hot Taps, that executes all given Tests. All tests will be interrupted on dispose.

    Parameter

    Parameter harness: The harness, that interprets the output.

    Parameter

    Parameter tests: All tests to be executed.

    Declaration

    Swift

    public static func start(with harness: TapsHarness? = nil, testing tests: [(Taps) -> Void]) -> Disposable

    Parameters

    harness

    The harness, that interprets the output.

    tests

    All tests to be executed.

  • Creates a hot Taps, that executes all given Tests. All tests will be executed. Exits with 1 if there were errors. All tests will be interrupted when Taps gets deinitialized.

    Parameter

    Parameter harness: The harness, that interprets the output.

    Parameter

    Parameter tests: All tests to be executed.

    Declaration

    Swift

    public static func runMain(with harness: TapsHarness? = nil, testing tests: [(Taps) -> Void]) -> Never

    Parameters

    harness

    The harness, that interprets the output.

    tests

    All tests to be executed.

  • Creates a hot Taps, that executes all given Tests. All tests will be interrupted when Taps gets deinitialized.

    Parameter

    Parameter harness: The harness, that interprets the output.

    Parameter

    Parameter tests: All tests to be executed.

    Declaration

    Swift

    public static func run(with harness: TapsHarness? = nil, testing tests: [(Taps) -> Void]) -> Taps

    Parameters

    harness

    The harness, that interprets the output.

    tests

    All tests to be executed.