/tdd-rspec

Use of TDD on exercises

Primary LanguageRuby

Test Driven Development: Rspec

Important Guide

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

How to use the tests:

Type on the tdd-spec directory:

rspec spec/hello_spec.rb