0

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
hellion
  • 4,602
  • 6
  • 38
  • 77

1 Answers1

1

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.

blowmage
  • 8,854
  • 2
  • 35
  • 40
  • So, either gem provides MiniTest::Spec. Its confusing to know which is best. Your gem is far more popular (judging from downloads). So, for using MiniTest::Spec and sliding right in to rails 4...either gem will work? If the answer is yes, then I will go back to using minitest-rails. I only switched two days ago just to check it out, due to some article I read. Your ping pong photo is enough to keep me on your gem... – hellion Apr 08 '13 at 03:48
  • One last question, ..why do some prefer mintest-spec-rails? – hellion Apr 08 '13 at 03:53
  • Both will enable the spec DSL in Rails. We've briefly discussed merging the gems, but there are no plans to do that ATM. – blowmage Apr 09 '13 at 15:20