Skip to content

Instantly share code, notes, and snippets.

@Kdan
Last active January 26, 2021 14:22
Show Gist options
  • Save Kdan/1c54c85fa3c91080176864a4dd91383d to your computer and use it in GitHub Desktop.
Save Kdan/1c54c85fa3c91080176864a4dd91383d to your computer and use it in GitHub Desktop.
class BMock: Mock<BMock.Functions>, B {
enum Functions: FunctionName {
/// The `FunctionName` corresponding to the `validateAnswer()` function.
case validateAnswer = "validateAnswer()"
}
/// The mocked response being returned by the `validateAnswer()` function.
var validateAnswerResponse = true
func validateAnswer() -> Bool { log(return: validateAnswerResponse) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment