Test-Driven Development (TDD) is a practice designed
to force developers to think about their code before writing it
Pruebas. Test Driven Development (TDD) y Rspec
This is done in small increments in which the developer must identify
increasingly more-complex interfaces to other objects as well as
build up the functionality of the object under development.
Here's the flow for development with RSpec:
In essence, a RSpec developer turns test cases from red (failing) to green (passing) all day.
- You write a test. This test describes the behavior of a small element of your system.
- You run the test. The test fails because you have not yet built the
code for that part of your system. This important step tests your
test case, verifying that your test case fails when it should.
- You write enough code to make the test pass.
- You run the tests and verify that they pass.
Casiano Rodriguez León