I have been using the minitest-rails gem, and everything works great when I run:

  rake minitest:models

However, I recently switched to the minitest-spec-rails gem, and when I run that same command I get this error:

 "Don't know how to build task 'minitest:models'"

Anyone know what the difference (in this regard) is between the two gems?

This is my rake file (that works with rake minitest:models)

require "rake/testtask"

Rake::TestTask.new(:test => "db:test:prepare") do |t| 
  t.libs << "test"
  t.pattern = "test/**/*_test.rb"
end

task :default => :test
有帮助吗?

解决方案

The minitest-spec-rails gem only enables the minitest spec DSL in your rails tests. So you will have to use the standard test rake tasks. To test just the files under test/models, you will need to create your own rake task.

The minitest-rails gem enables the spec DSL, as well as provides generators that use the spec DSL, and additional rake tasks. It can help bridge the gap between Rails 3 and 4.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top