Created
March 31, 2019 18:00
-
-
Save polac24/8b832f8bf403035e7f95bb5ccafeeaf9 to your computer and use it in GitHub Desktop.
This file contains 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
class DatabaseStub: Database { | |
lazy var addUserAction = niceStub(of: addUser, thatReturns: true) | |
func addUser(name: String) -> Bool { | |
return addUserAction(name) | |
} | |
} | |
func testAddingUser_savesToDatabase () { | |
// Act | |
database.addUser(name: "user1") // ✅, doesn't crash | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment