How to remove minitest from Rails

I am using Ruby 2.2.0p0 and Rails 4.2.0. Currently, the Rails application uses minitest by default, although there are no test stones in the Gemfile. For example, I have rake test in my rake tasks and the test folder.

I see how to install RSpec rails. But what do I need to do to remove minitest?

The only thing RSpec-Rails README has

After installation, RSpec will generate specification files instead of Test :: Unit test files when commands, such as rails, generate a model and rails controller.

+6
source share
1 answer

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

 config.generators.test_framework :rspec 

What is it. Rails now knows that you are using RSpec, and when you use Rails generators, it will add the corresponding RSpec guardian files, not Minitest. If you have a test folder in your application (it is used by Minitest and Test :: Unit), you can delete it now.

+6
source

All Articles