问题
I'm generally clear on bundler Gemfile options, but I'm not sure why rspec (specifically, rspec-rails) should be in both test and development.
Here are my test groupings:
group :development, :test do
gem 'rspec-rails'
gem 'faker'
end
group :test do
gem "factory_girl_rails"
gem "capybara"
gem 'guard-rspec'
gem 'rb-fsevent'
gem 'growl'
end
Does this look ok?
回答1:
I am quoting the official documentation:
Add rspec-rails to the :test and :development groups in the Gemfile:
group :test, :development do
gem "rspec-rails", "~> 2.6"
end
It needs to be in the :development group to expose generators and rake tasks without having to type RAILS_ENV=test.
来源:https://stackoverflow.com/questions/10413534/why-do-people-group-rspec-under-test-and-development-in-the-gemfile