Ruby on rails 使用RSpec时移除耙测试?
我在Rails应用程序中使用RSpec,但在执行Ruby on rails 使用RSpec时移除耙测试?,ruby-on-rails,rspec,Ruby On Rails,Rspec,我在Rails应用程序中使用RSpec,但在执行rake-T时,我仍然得到默认的testrake任务: rake spec # Run all specs in spec directory (excluding plugin specs) / Run RSpec cod... rake spec:controllers # Run the code examples in spec/controllers rake spec:models # Run the
rake-T
时,我仍然得到默认的test
rake任务:
rake spec # Run all specs in spec directory (excluding plugin specs) / Run RSpec cod...
rake spec:controllers # Run the code examples in spec/controllers
rake spec:models # Run the code examples in spec/models
rake spec:requests # Run the code examples in spec/requests
rake spec:routing # Run the code examples in spec/routing
rake stats # Report code statistics (KLOCs, etc) from the application
rake test # Runs test:units, test:functionals, test:integration together
rake test:all # Run tests quickly by merging all types and not resetting db
rake test:all:db # Run tests quickly, but also reset db
这正常吗?是否可以/应该以某种方式删除它们?转到您的
config/application.rb
文件并替换
require 'rails/all'
为此:
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
注意,现在我们不再加载测试单元,因此它的rake任务将不包括在内。转到您的
config/application.rb
文件并替换
require 'rails/all'
为此:
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
注意,现在我们不再加载test_单元,所以它的rake任务将不包括在内