Why do people group rspec under test and development in the Gemfile?

喜夏-厌秋 提交于 2019-12-21 06:48:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!