Run your specs in logical groups

Posted on Apr 5, 2012

I stumbled upon this StackOverflow question: testing – Organizing rspec 2 tests into ‘unit’ and ‘integration’ categories in rails – Stack Overflow.

Basically, the guy asks how he can run specs isolated into logical groups, running the unit without running the integration and so on.

At Gogobot, we have exactly that, since we run our specs in the CI, we can decide which to run, and they run one after the other and dependent on each other, so if you fail UNIT, the build fails, no need to continue on.

You can run the rakes like so

 

This is what our spec.rake looks like