A Word About Test-Driven Development
We’ve built our apps a bit backward from the accepted practice in the Ruby community. You should be writing your tests first, using them to drive the development of features. We didn’t do that; we started with code and added tests afterward. This was done purely to make it easier to learn concepts about command-line app development. We needed to know what to test before learning how to test. To be clear, we are not endorsing “test-last development.”
To write command-line apps using Test-Driven Development (TDD), you can apply the same principles we’ve learned here, but just start with the tests instead of the code. (See Kent Beck’s Book on TDD [Bec02].) The simplest thing to do is to start using Cucumber ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access