Created
October 18, 2019 02:11
-
-
Save andrewchang-bird/78b268b8f560e95cf416443e1fbfbda9 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
func testShakingTree_makesBirdFly() { | |
// Setup | |
let bird = mock(Bird.self) | |
let tree = Tree(with: bird) | |
// Given the bird can fly | |
given(bird.canFly()) ~> true | |
// When the tree is shaken | |
tree.shake() | |
// Then the bird flies away | |
verify(bird.fly()).wasCalled() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment