About a month ago, I made my first PR to the Ruby programming language ecosystem, specifically the Rake project.
A few weeks ago, my PR was merged into the main branch, and they even released a release with this fix. This fix allows you to pass multiple test files in the TEST environment variable, which should be run when running the bundle exec rake test command. For example:
# Specific files
TEST=test/unit/test_some.rb,test/integration/test_other.rb bundle exec rake test
# All files in specified folders and subfolders
TEST=test/unit/**/*.rb,test/integration/**/*.rb bundle exec rake test
To take advantage of this feature, make sure you are using rake version 13.4.0 or later and have tests configured to run via Rake::TestTask:
# Gemfile
gem 'rake', '~> 13.4.0'
# Rakefile
require 'rake'
require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << "test"
t.pattern = "test/**/test_*.rb"
end