Search code examples
ruby-on-railstestunitspork

Running all tests with Rails / Spork / TestUnit


The docs here say:

Then, once spork is running, invoke testdrb (e.g. testdrb -Itest test/your_test.rb) to run your tests under Spork.

But this only runs one at a time

Without specifying a file it fails:

$ testdrb
Exception encountered: #<SystemExit: exit>

I've found I can do this which helps a bit:

testdrb -I test test/functional/*

But still don't know how to run them all with one simple command the way I could with

rake test

Solution

  • I usually write this for all tests :

    testdrb -I test ./test/**/*_test.rb
    

    To make things simple, I add this to my .bashrc

    alias td="testdrb -I test"
    alias tdall="testdrb -I test ./test/**/*_test.rb"