Here is my entire rakefile
, which I put in my top directory:
task :default => :test
task :test do
Dir.glob('./test/*_test.rb').each { |file| require file}
end
To run all my test files at once, I just type rake
. That's it!
Make sure to have require 'minitest/autorun'
at the top of each of your Minitest files. Dir.glob definitely DOES work with Minitest.
To get pretty, colored Minitest output, with names of all my test methods, I have the file minitest_helper.rb
in my /test directory. (Had to install the gem minitest-reporters):
require 'minitest/reporters'
Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new)
require 'minitest/autorun'
I just had to require_relative './minitest_helper'
at the top of each of my test files.