为什么人们在 Gemfile 中对 rspec 进行测试和开发? [英] Why do people group rspec under test and development in the Gemfile?
本文介绍了为什么人们在 Gemfile 中对 rspec 进行测试和开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我通常清楚 bundler Gemfile 选项,但我不确定为什么 rspec(特别是 rspec-rails)应该同时用于测试和开发.
这是我的测试分组:
group :development, :test dogem 'rspec-rails'宝石伪造者"结尾组:测试做宝石factory_girl_rails"宝石水豚"gem 'guard-rspec'宝石'rb-fsevent'宝石'咆哮'结尾
这样好吗?
解决方案
我引用了官方文档:
<块引用>将 rspec-rails 添加到 Gemfile 中的 :test 和 :development 组:
group :test, :development 做gem "rspec-rails", "~> 2.6"结尾
<块引用>
需要在 :development 组中才能暴露生成器和 rake无需输入 RAILS_ENV=test 即可完成任务.
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?
解决方案
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.
这篇关于为什么人们在 Gemfile 中对 rspec 进行测试和开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文