Reputation: 763
I have, let's say:
emp_test.rb
sales_emp_test.rb
corporate_emp_test.rb
payroll_emp_test.rb
How can I run them all together? Should I include them into another test file?
I am using test/unit gem.
Upvotes: 7
Views: 4331
Reputation: 1466
Create another ruby file and require all test files you want to run.
For example, I can create an all.rb
file inside my test
folder with this code:
Dir[File.dirname(File.absolute_path(__FILE__)) + '/**/*_test.rb'].each {|file| require file }
That would run every *_test.rb
file found inside the test
folder tree.
Run it with ruby -Itest test/all.rb
from your project root.
Upvotes: 11