Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I was reading the Rails Tutorial and following along like a good drone installing everything the way it said and doing everything it told me. Then I realized I didn't like the book any more for a number of reasons and quit reading it. But I had already created my own project with Rspec installed as it told me to. Then I find out that Rspec is quite a bit more complicated than the built in Test::Unit and every other book I read is telling me how to use Test::Unit, including the excellent 'Rails Test Prescriptions' by Pragmatic. (I wish I'd started with them first.) Anywho, the book does teach Rspec a little bit but not until after you get past Test::Unit. Now I can't scrape Rspec out of my project. There is a 'rails generate rspec:install' but no uninstall and my tests now default to Rspec. I can force a unit test with 'rake test' but if I use 'rake' it goes to Rspec. There are other remnants of Rspec too, like in the --help for 'rails generate'. My concern is that as I get more involved with vanilla Test I'll find more problematic areas. I removed or renamed the files / folders generated by the installation. I also looked for changes to my config files but couldn't find any. I intend to consider Rspec down the road but for now I'd like to have a clean project to work with.

like image 246
leetheguy Avatar asked Mar 24 '11 01:03

leetheguy


1 Answers

You can do following,
1) Remove spec directory
2) Remove all rspec related gems (capybara, faker, etc.) from the Gemfile
3) Run 'bundle clean --force' command to remove all unused gems and then run 'bundle install' again
4) Now 'bundle list' should show you all the gems except rspec related

like image 143
Atarang Avatar answered Oct 20 '22 01:10

Atarang