Skip to content

Instantly share code, notes, and snippets.

@victorpanitz
Created October 26, 2019 05:35
Show Gist options
  • Save victorpanitz/953b7f8e1212d636314c718e033f1b8a to your computer and use it in GitHub Desktop.
Save victorpanitz/953b7f8e1212d636314c718e033f1b8a to your computer and use it in GitHub Desktop.
func given<A>(_ description: String, block: () throws -> A) rethrows -> A {
return try XCTContext.runActivity(named: "Given " + description, block: { _ in try block() })
}
func when<A>(_ description: String, block: () throws -> A) rethrows -> A {
return try XCTContext.runActivity(named: "When " + description, block: { _ in try block() })
}
func then<A>(_ description: String, block: () throws -> A) rethrows -> A {
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