How to run all the test files in a directory with Rake, from the command line?

51 Views Asked by At

I have some test folder:

app/
  test/
    folder1/
      test1.rb
      test2.rb
    folder2/
      test2_1.rb
      test2_2.rb
      test2_3.rb

I want to run only the tests from the 'folder2' directory (not only one tests file), from the command line (without implementing a Rake TestCase). Not with ruby on rails.

I tried:

rake test TEST=test/folder1/test*.rb
1

There are 1 best solutions below

0
Philippe Perret On

For a pattern, the asterisk must be escaped.

Solution:

rake test TEST=test/folder1/test\*.rb