Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

you should require 'minitest/autorun' instead. in ruby on rails

I am creating an application on ruby on rails:

After creating users, for validating users I am running below commands:

$ bundle exec rake db:migrate
$ bundle exec rake test:prepare

Both command are run properly on the rails commandLine, but when I run the below command:

$ bundle exec rspec spec/models/user_spec.rb

I am getting error below:

Warning: you should require 'minitest/autorun' instead.
Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'

And I am using 4.1.1 version of rails. I don't understand why it comes. Kindly suggest me, waiting for your reply. Thanks.

like image 477
user88 Avatar asked Jun 13 '14 12:06

user88


1 Answers

More a note for posterity than anything, but this issue can also happen if you're using an older version of shoulda-matchers. You can see some discussion around this on their Github repo here, or on the rspec-rails repo here.

Update shoulda-matchers by running bundle update shoulda-matchers. You want the latest version (or at least 2.6.2) and this message should go away.

like image 186
Chris Nelson Avatar answered Sep 23 '22 06:09

Chris Nelson