Skip to content

Instantly share code, notes, and snippets.

@victorpanitz
Last active October 26, 2019 05:32
Show Gist options
  • Save victorpanitz/7646991126a28fa15eb3ee2d48ea706a to your computer and use it in GitHub Desktop.
Save victorpanitz/7646991126a28fa15eb3ee2d48ea706a to your computer and use it in GitHub Desktop.
func given<A>(_ description: String, block: (XCTActivity) throws -> A) rethrows -> A {
return try XCTContext.runActivity(named: "Given " + description, block: block)
}
func when<A>(_ description: String, block: (XCTActivity) throws -> A) rethrows -> A {
return try XCTContext.runActivity(named: "When " + description, block: block)
}
func then<A>(_ description: String, block: (XCTActivity) throws -> A) rethrows -> A {
return try XCTContext.runActivity(named: "Then " + description, block: block)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment