RSpec intro

07 February 2017

  • rspec
  • spec
  • testing
  • test
  • ruby
  • rails
DESCRIPTION: RSpec is a testing GEM for Ruby, supposedly easier to read for non-developers.

Its documentation is located here:


To install: $ gem install rspec

This gives you access to $ rspec from the terminal.

To initialize in the project: $ rspec --init

To install rspec into the current rails project: $ rails g rspec:install

To add color and formatting to the rspec testing code: $ rspec --color --format documentation and then the file path.

Run tests

Run the command in the terminal $ bundle exec rspec