gem install rspec
rspec --help
rspec --init
├── lib
│ └── hello.rb
└── spec
└── hello_spec.rb
RED - GREEN - REFACTOR
- Step 1: Write a failing test (RED)
- Step 2: Write the simplest code possible to pass the test (GREEN)
- Step 3: Clean up (REFACTOR)
- Step 4: Repeat until all expectations have been satisfied
Type on the tdd-spec directory:
rspec spec/hello_spec.rb