Cleanly remove Rspec and use vanilla Unit :: Test in Rails 3.x

I read the Rails tutorial and followed it like a good buzz, setting everything up as he said, and doing everything he told me. Then I realized that I no longer liked the book for a number of reasons and did not read it. But I already created my own project with Rspec installed, as I told it. Then I find out that Rspec is more complicated than the built-in Test :: Unit, and every other book I read tells me how to use Test :: Unit, including the excellent “Rails Test Prescriptions” from Pragmatic. (I wish I started with them first.) Anywho, the book teaches Rspec a bit, but only after you pass Test :: Unit. Now I can not clear Rspec from my project. There is "rails generate rspec: install", but it is not removed, and my tests now default to Rspec. I can force unit test to use "rake test", but if I use "rake", it goes into Rspec. There are other remnants of Rspec, for example, in -help for generating rails. I am worried that as I become more involved in the vanilla test, I will find more problematic areas. I deleted or renamed the files / folders generated by the installation. I also looked for changes in my configuration files, but could not find them. I intend to review Rspec along the way, but for now I would like to have a clean project to work with.

+7
source share
3 answers

You may have already done this, but thought that I would just throw it away. Have you removed the RSpec links from your Gemfile?

+2
source

You can do the following,
1) Delete the specification catalog
2) Remove all rspec-related gems (capybara, faker, etc.) from the gemfile
3) Run the command "bundle clean -force" to remove all unused gems, and then run "bundle install" again

4) Now the "list of bundles" should show you all the gems, except those related to rspec

+2
source

In config / application.rb, changed

require "active_model/railtie" require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" require "sprockets/railtie" require "rails/test_unit/railtie" 

to

 require 'rails/all' 
0
source

All Articles