How do I run all the unit tests I have in a single command folder?
1 answer
Create another ruby file and require all the test files you want to run.
For example, I can create a file all.rb
inside my folder test
using this code:
Dir[File.dirname(File.absolute_path(__FILE__)) + '/**/*_test.rb'].each {|file| require file }
This will run every *_test.rb
file found inside the folder tree test
.
Run it ruby -Itest test/all.rb
from the project root.
+4
source to share