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 Observable
s, use RxTaps
.
-
Creates a cold
Taps
instance using aTapsHarness
, that won’t start runningTest
s by default.Parameter
Parameter harness: TheTapsHarness
that shall be used. UsesTapHarness.printHarness
by default.Declaration
Swift
public init(harness: TapsHarness? = nil)
Parameters
harness
The
TapsHarness
that shall be used. UsesTapHarness.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
Test
s for the currentTaps
. All tests will be interrupted on dispose.Declaration
Swift
public func start() -> Disposable
-
Starts to execute all
Test
s for the currentTaps
. All tests run until all are finished.Declaration
Swift
public func run()
-
Starts to execute all
Test
s for the currentTaps
. 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 givenTest
s. Uses the print harnessTapHarness.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 givenTest
s. Uses the print harnessTapHarness.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 givenTest
s. 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 givenTest
s. All tests will be executed. Exits with 1 if there were errors. All tests will be interrupted whenTaps
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 givenTest
s. All tests will be interrupted whenTaps
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.