title: How to run multiple Rails unit tests at once
body: <p>I often run the various test groups like:</p>
  
  <pre><code>rake test:units
  rake test:functionals
  </code></pre>
  
  <p>I also like to run individual test files or individual tests:</p>
  
  <pre><code>ruby -Itest test/unit/file_test.rb
  ruby -Itest test/unit/file_test.rb -n '/some context Im working on/'
  </code></pre>
  
  <p>There's also:</p>
  
  <pre><code>rake test TEST=test/unit/file_test.rb
  </code></pre>
  
  <p>And I've even created custom groupings in my Rakefile:</p>
  
  <pre><code>  Rake::TestTask.new(:ps3) do |t|
      t.libs &lt;&lt; 'test'
      t.verbose = true
      t.test_files = FileList["test/unit/**/ps3_*_test.rb", "test/functional/services/ps3/*_test.rb"]
    end
  </code></pre>
  
  <p>What I haven't figured out yet is how to run multiple ad-hoc tests at the command line.  In other words, how can I inject test_files into the rake task.  Something like:</p>
  
  <pre><code>rake test TEST=test/unit/file_test.rb,test/functional/files_controller_test.rb
  </code></pre>
  
  <p>Then I could run a shell function taking arbitrary parameters and run the fast <code>ruby -Itest</code> single test, or a <code>rake</code> task if there's more than one file.</p>