Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall minitest from Rails

I'm using Ruby 2.2.0p0, and Rails 4.2.0. The Rails application is currently defaulting to using minitest, even though there's no testing gems mentioned in the Gemfile. For example, I have rake test in my rake tasks, and a test folder.

I can see how to install RSpec-rails. But what, if anything, do I need to do to uninstall minitest?

The only thing the RSpec-Rails README has is

Once installed, RSpec will generate spec files instead of Test::Unit test files when commands like rails generate model and rails generate controller are used.

like image 659
Andrew Grimm Avatar asked Jul 26 '15 23:07

Andrew Grimm


1 Answers

It seems to me that in your case it not necessary to uninstall minitest, just add rspec to your Gemfile and start using it. However I recommend you to make RSpec as your default test framework. Just add to config/application.rb next line:

config.generators.test_framework :rspec

That's it. Now Rails knows that you use RSpec and when you use Rails generators, it will add appropriate RSpec templete files, not Minitest ones. If you have test folder in your application (it's used by Minitest and Test::Unit) you can delete it now.

like image 197
Tetiana Chupryna Avatar answered Sep 21 '22 09:09

Tetiana Chupryna