Installing RSpec
Learn how to install RSpec.
RSpec Gemfile
Before we start testing, we’ll need to load RSpec, our testing library.
To add RSpec to a Rails project, we’ll add the rspec-rails gem to the Gemfile:
Press + to interact
group :development, :test dogem "rspec-rails"end
The rspec-rails gem dependencies
The Rspec gem is mostly a list of other dependencies where the real work gets done, including:
- The
RSpec-coredependency - The
rspec-expectationsdependency - The
rspec-mocksdependency
Sometimes rspec and rspec-rails are updated separately. We might choose to specify both versions in the Gemfile explicitly. Here, we’re putting rspec ...
Ask