Skip to content

Instantly share code, notes, and snippets.

@nelstrom
Created July 8, 2015 19:22
Show Gist options
  • Save nelstrom/6285e547d15a78965b33 to your computer and use it in GitHub Desktop.
Save nelstrom/6285e547d15a78965b33 to your computer and use it in GitHub Desktop.

Write a simple library to enable testing with spies.

Here's a simple ruby app which interacts with a database. The app has a passing test suite, but the tests are difficult to follow because they ask questions about return values. Refactor the tests so that they observe collaborators that have side-effects (rather than examining those side-effects).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment