Unit Testing vs Unit Testing in Ruby

Posted by Matt Farmer on December 14, 2012 · 1 min read

Reasons you unit test:

  • It helps you think out how new code should be designed in Test Driven Development, because you’re actually writing something that uses the code that doesn’t exist yet.
  • Regression testing – so you can make sure new code doesn’t open old bugs.
  • It enables you to do things like set up a continuous integration and continuous deployment flow that greatly simplifies the process of getting code out to your production server.
  • You don’t want The Profound Programmer knocking on your door with a shovel.
  • If you use remote APIs, things on the API may change without notice – causing problems.

Reasons you unit test in Ruby:

  • No type safety.