The most common way to install the RSpec gem is using Bundler. Add this line to your application's Gemfile
:
gem 'rspec'
And then execute bundle
to install the dependencies:
$ bundle
Alternatively, you can install the gem manually:
$ gem install rspec
After installing the gem, run the following command:
rspec --init
This will create a spec
folder for your tests, along with the following config files:
spec
directory into which to put spec filesspec/spec_helper.rb
file with default configuration options.rspec
file with default command-line flags