Installing RSpec
Learn how to install RSpec.
We'll cover the following...
We'll cover the following...
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:
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 ...