Skip to content

Instantly share code, notes, and snippets.

@andrewchang-bird
Created October 18, 2019 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewchang-bird/78b268b8f560e95cf416443e1fbfbda9 to your computer and use it in GitHub Desktop.
Save andrewchang-bird/78b268b8f560e95cf416443e1fbfbda9 to your computer and use it in GitHub Desktop.
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