Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3 - If I'm using RSpec, can I just delete the 'test' folder?

While trying to migrate, I keep getting this error:

rake aborted!
test-unit is not part of the bundle. Add it to Gemfile.

If I'm using RSpec, can I just delete the test folder altogether?

like image 925
teecraft Avatar asked Oct 12 '10 14:10

teecraft


People also ask

How do I run a test file in RSpec?

To run a single Rspec test file, you can do: rspec spec/models/your_spec. rb to run the tests in the your_spec. rb file.

Why do we use RSpec?

RSpec is a testing tool for Ruby, created for behavior-driven development (BDD). It is the most frequently used testing library for Ruby in production applications. Even though it has a very rich and powerful DSL (domain-specific language), at its core it is a simple tool which you can start using rather quickly.

What is Spec folder in Ruby on Rails?

Rails default testing framework gives you test folder for you rails default testing framework, if you want to use RSpec testing framework, which gives you folder called 'spec' RSPEC, it is your wish to select which option, RSPEC specs are more readable, people use both ways.


2 Answers

This error means that somewhere inside your project there is a require test-unit without it being specified in the Gemfile.

So you should actually try to find that statement and remove it to fix this error (or add the dependency to the gemfile --but that sounds a bit backwards if you are not using it).

Anyway: you can definitely remove the test folder if you are using rspec.

like image 183
nathanvda Avatar answered Nov 01 '22 02:11

nathanvda


I believe so. Rspec should only be looking for tests in ../spec/*

like image 1
chuck son Avatar answered Nov 01 '22 02:11

chuck son