What is Test-Driven Development in Ruby?
TDD steps:
- Write a test that describes some shortcoming or missing feature in the code.
- Run the tests.
- Write just enough code to make this test pass.
- Run the tests again.
- Refactor.
- Write a test to define a new feature and start the process all over again.
Always remember:
- Code doesn't exist yet until it's tested.
- Run tests religiously.
See more: