Skip to content

Rebuild Minitap on Minitest's plugin system - #8

Merged
trans merged 1 commit into
masterfrom
plugin-system
Nov 22, 2026
Merged

trans merged 1 commit into
masterfrom
plugin-system

Conversation

@trans

@trans trans commented Nov 21, 2026

Copy link
Copy Markdown
Member

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 --tapy and --tapj. Minitest 5 still finds the plugin by itself; Minitest 6 no longer scans for plugins, so there the require (or Minitest.load :minitap) is needed.
  • The format can be chosen in code with Minitap.tapy!, Minitap.tapj! or Minitap.format = :tapy. Minitest.reporter = Minitap::TapY no longer does anything.
  • require 'minitap/autorun' works again.
  • The minitest-reporter-api dependency is gone. It replaced Minitest.run with a copy from 2013.

Fixes in the stream

  • Cases are labelled with the test class. They were all Minitest::Result on Minitest 5.11 and newer.
  • A failure's location is in the test file. On Ruby 3.4 and newer it pointed into Minitest's assertions.rb.
  • Skipped tests have the status omit, as TAP-Y/J specifies, not skip.
  • An error is reported with the class and message of the error raised, not of Minitest's wrapper.
  • Tests run in the order the seed gives them without Minitap.

Structure

  • lib/minitap.rb: the plugin module (minitest_plugin_options, minitest_plugin_init), registered with Minitest.register_plugin where 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::Reporter and its TapY and TapJ subclasses, replacing the 885-line minitest5.rb.
  • Plain gemspec, Rakefile and GitHub Actions in place of .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 TestTask and Minitest::TestTask into Tapout.

Version is 0.6.0 in version.rb; HISTORY has the entry under Unreleased.

🤖 Generated with Claude Code

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>
@trans
trans merged commit 13fb0d5 into master Nov 22, 2026
20 checks passed
@trans trans mentioned this pull request Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant