From 4619026a09748a57745553c4b04f43f947e043b1 Mon Sep 17 00:00:00 2001 From: Ufuk Kayserilioglu Date: Tue, 13 Jan 2026 20:50:35 +0200 Subject: [PATCH] Fix test runner and output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that this gem is on Minitest 6, we are able to use its own runner for running tests. So, I created a binstub for the `minitest` command exported from the `minitest` gem and renamed it to `bin/test`. This way, we can continue to use the (almost) same command line interface for running tests, but we also get running tests by line number too 🎉 Additionally, since Minitest no longer automatically registers plugins, we need to fix up how we register Minitest reporters that we were registering. --- bin/test | 25 ++++++++++++++++--------- test/test_helper.rb | 2 ++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/bin/test b/bin/test index dfa37a07..8fef6665 100755 --- a/bin/test +++ b/bin/test @@ -1,9 +1,16 @@ -#!/usr/bin/env bash - -if [[ 2 -eq $# ]]; then - bundle exec rake TEST="$1" TESTOPTS="-n='/$2/'" -elif [[ 1 -eq $# ]]; then - bundle exec rake TEST="$1" -else - bundle exec rake "$@" -fi +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'minitest' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("minitest", "minitest") diff --git a/test/test_helper.rb b/test/test_helper.rb index f433e490..05803786 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -50,5 +50,7 @@ def default_spoom_test_gemfile require "minitest/autorun" require "minitest/reporters" +require "minitest/minitest_reporter_plugin" +Minitest.register_plugin(:minitest_reporter) Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new(color: true))