Repository navigation
Rebuild Minitap on Minitest's plugin system - #8
Merged
Merged
Conversation
Minitap is now a plain Minitest plugin: it registers itself when required, takes --tapy and --tapj, and the format can be chosen in a test helper with Minitap.tapy! or Minitap.tapj!. It no longer depends on minitest-reporter-api, which replaced Minitest.run with a copy from 2013, and it works with Minitest 5.11 to 6. The reporter is rewritten. It labels cases by test class instead of Minitest::Result, locates failures in the test file on Ruby 3.4 and newer, reports skips as omit, and names the error raised instead of Minitest's wrapper. Packaging is a plain gemspec with GitHub Actions, testing Ruby 2.7 to 4.0 against Minitest 5 and 6. The retirement notice is removed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings Minitap back from retirement and makes it work with current Minitest, 5.11 through 6, as an ordinary Minitest plugin.
What changes for users
require 'minitap'in the test helper registers the plugin and adds--tapyand--tapj. Minitest 5 still finds the plugin by itself; Minitest 6 no longer scans for plugins, so there the require (orMinitest.load :minitap) is needed.Minitap.tapy!,Minitap.tapj!orMinitap.format = :tapy.Minitest.reporter = Minitap::TapYno longer does anything.require 'minitap/autorun'works again.minitest-reporter-apidependency is gone. It replacedMinitest.runwith a copy from 2013.Fixes in the stream
Minitest::Resulton Minitest 5.11 and newer.assertions.rb.omit, as TAP-Y/J specifies, notskip.Structure
lib/minitap.rb: the plugin module (minitest_plugin_options,minitest_plugin_init), registered withMinitest.register_pluginwhere that exists (5.24 and newer).lib/minitest/minitap_plugin.rb: the by-name hooks for older Minitest, which do nothing once the module is registered.lib/minitap/reporter.rb:Minitap::Reporterand itsTapYandTapJsubclasses, replacing the 885-lineminitest5.rb..index,Assembly,var/and Travis.Testing
Six QED demos (62 steps) run each test file in a process of its own and check the stream, including a pass through Tapout. I ran them locally in containers on Ruby 2.7, 3.0, 3.1, 3.4 and 4.0 with Minitest 5.11.3, 5.24.0, 5.26 and 6.1.0. I also installed the built gem into a clean directory and ran it through Rake's
TestTaskandMinitest::TestTaskinto Tapout.Version is 0.6.0 in
version.rb; HISTORY has the entry under Unreleased.🤖 Generated with Claude Code