gpt4 book ai didi

ruby-on-rails - 为什么人们在 Gemfile 中对 rspec 进行测试和开发?

转载 作者:行者123 更新时间:2023-12-03 10:15:36 25 4
gpt4 key购买 nike

我通常很清楚 bundler Gemfile 选项,但我不确定为什么 rspec(特别是 rspec-rails)应该同时用于测试和开发。

这是我的测试分组:

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

这看起来好吗?

最佳答案

我在引用 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.

关于ruby-on-rails - 为什么人们在 Gemfile 中对 rspec 进行测试和开发?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10413534/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com