diff --git a/README.md b/README.md index f037734..aec180a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ # Chain -A description of this package. +> Chain.link.complete + +```swift +Chain.link( + { print("Chain.link") }, + .complete { print("Chain.complete") } +) +.run() +``` diff --git a/Tests/ChainTests/ChainTests.swift b/Tests/ChainTests/ChainTests.swift index 289d864..9bc8b92 100644 --- a/Tests/ChainTests/ChainTests.swift +++ b/Tests/ChainTests/ChainTests.swift @@ -3,46 +3,23 @@ import XCTest final class ChainTests: XCTestCase { func testExample() { - var isLooping = true - var text = "" - Chain.link( { print(0) }, .link( { print(1) }, - .background( - { print(2) - sleep(3) - }, - .link( - { print(3) }, - .complete { - text = "Hello, World?" - } - ) + .link( + { print(3) }, + .complete { + text = "Hello, World!" + } ) ) ) .run() - Chain.background( - { - sleep(5) - }, - .link( - { - XCTAssertEqual(text, "Hello, World!") - }, - .complete { - isLooping = false - } - ) - ) - .run() - - while isLooping { } + XCTAssertEqual(text, "Hello, World!") } static var allTests = [