Created
October 27, 2019 05:30
-
-
Save victorpanitz/ebe827284debf2a0c3ad53a02d26e487 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.log | |
func given<A>(_ description: String, block: () throws -> A) rethrows -> A { | |
os_log("1º Given %{public}@", description) | |
return try XCTContext.runActivity(named: "Given " + description, block: { _ in try block() }) | |
} | |
func when<A>(_ description: String, block: () throws -> A) rethrows -> A { | |
os_log("2º When %{public}@", description) | |
return try XCTContext.runActivity(named: "When " + description, block: { _ in try block() }) | |
} | |
func then<A>(_ description: String, block: () throws -> A) rethrows -> A { | |
os_log("3º Then %{public}@", description) | |
return try XCTContext.runActivity(named: "Then " + description, block: { _ in try block() }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment