[GH-7502] Add Minitest support#32
Merged
Stelios Frantzeskakis (steliosfran) merged 3 commits intoJun 3, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Stelios Frantzeskakis (steliosfran)
June 2, 2026 22:03
View session
There was a problem hiding this comment.
Pull request overview
This PR adds first-class Minitest support to Rubyzen by splitting the framework-agnostic core from framework-specific adapters, and by introducing Minitest assertion equivalents to the existing RSpec matchers. It also updates docs, sample project lint rules, CI, and packaging to reflect the new dual-framework support and the breaking require-path change for RSpec users.
Changes:
- Introduces
rubyzen/core+ two adapters:rubyzen/rspec(matchers) andrubyzen/minitest(assertions). - Adds Minitest assertions (
assert_zen_empty,assert_zen_true,assert_zen_false) backed by sharedExpectationHelpers. - Updates gemspec/deps, docs, sample project, and CI to run both RSpec and Minitest suites.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_helper.rb | Adds Minitest test helper + ParseHelper for the new test suite. |
| test/minitest_adapter_test.rb | Verifies require 'rubyzen/minitest' contract and assertions availability. |
| test/assertions/assert_zen_true_test.rb | Minitest coverage for assert_zen_true. |
| test/assertions/assert_zen_false_test.rb | Minitest coverage for assert_zen_false. |
| test/assertions/assert_zen_empty_test.rb | Minitest coverage for assert_zen_empty. |
| spec/spec_helper.rb | Switches RSpec suite to require 'rubyzen/rspec' entry point. |
| sample_project/test/test_helper.rb | Adds Minitest lint-rule base class (LintTestCase) for sample project. |
| sample_project/test/repos/repos_test.rb | Minitest version of a sample lint rule. |
| sample_project/test/models/no_arguments_named_biz_test.rb | Minitest version of a sample lint rule. |
| sample_project/test/database/do_not_call_active_record_models_outside_repos_test.rb | Minitest version of a sample lint rule (ActiveRecord call detection). |
| sample_project/test/controllers/no_if_statements_in_controllers_test.rb | Minitest version of a sample lint rule (if statements). |
| sample_project/spec/spec_helper.rb | Switches sample project RSpec suite to require 'rubyzen/rspec'. |
| sample_project/spec/modules/module_file_path_consistency_lint_spec.rb | Removes redundant requires; relies on spec_helper. |
| sample_project/spec/models/no_requires_in_models_lint_spec.rb | Removes redundant requires; relies on spec_helper. |
| sample_project/spec/constants/no_top_level_constants_lint_spec.rb | Removes redundant requires; relies on spec_helper. |
| sample_project/spec/attributes/no_public_attr_writer_in_models_lint_spec.rb | Removes redundant requires; relies on spec_helper. |
| rubyzen-lint.gemspec | Moves rspec to dev dependency; adds minitest/rake dev deps; includes CHANGELOG metadata. |
| README.md | Documents adapter entry points and adds Minitest usage examples. |
| Rakefile | Adds default rake task to run both RSpec and Minitest unit suites. |
| lib/rubyzen/version.rb | Bumps gem version to 0.2.0. |
| lib/rubyzen/rspec.rb | Adds RSpec adapter entry point and friendly missing-gem error. |
| lib/rubyzen/providers/blocks_provider.rb | Updates provider doc wording (block forms). |
| lib/rubyzen/minitest.rb | Adds Minitest adapter entry point and assertion mixin hook. |
| lib/rubyzen/matchers/zen_true_matcher.rb | Switches matcher helper include to shared ExpectationHelpers. |
| lib/rubyzen/matchers/zen_false_matcher.rb | Switches matcher helper include to shared ExpectationHelpers. |
| lib/rubyzen/matchers/zen_empty_matcher.rb | Switches matcher helper include to shared ExpectationHelpers. |
| lib/rubyzen/matchers/matcher_helpers.rb | Removes matcher-only helper in favor of framework-agnostic helper. |
| lib/rubyzen/expectation_helpers.rb | Introduces shared engine for failure formatting + allowlist/baseline classification. |
| lib/rubyzen/core.rb | Introduces framework-agnostic Zeitwerk loader + Rubyzen configuration. |
| lib/rubyzen/assertions/zen_assertions.rb | Adds Minitest assertion module + requires assertion implementations. |
| lib/rubyzen/assertions/assert_zen_true.rb | Implements assert_zen_true with allowlist/baseline + rich messages. |
| lib/rubyzen/assertions/assert_zen_false.rb | Implements assert_zen_false with allowlist/baseline + rich messages. |
| lib/rubyzen/assertions/assert_zen_empty.rb | Implements assert_zen_empty with allowlist/baseline + rich messages. |
| lib/rubyzen.rb | Redefines require 'rubyzen' to load core only (no test framework). |
| CONTRIBUTING.md | Updates contributor guidance for running both test suites and sample lint rules. |
| CLAUDE.md | Updates architecture docs to include adapters + assertions and updated usage. |
| CHANGELOG.md | Adds 0.2.0 release notes and migration note. |
| .github/workflows/tests.yml | Runs both RSpec and Minitest in CI. |
| .github/PULL_REQUEST_TEMPLATE.md | Updates checklist to bundle exec rake + YARD docs. |
| .github/ISSUE_TEMPLATE/bug_report.md | Updates environment section to be test-framework-agnostic. |
| .claude/skills/write-lint-rule/SKILL.md | Updates skill docs/examples to include Minitest adapter usage. |
| .claude/skills/run-tests/SKILL.md | Updates skill docs for dual-suite testing commands. |
| .claude/skills/run-lint-rules/SKILL.md | Updates skill docs for running sample lint rules via both frameworks. |
| .claude/skills/expand-rubyzen/SKILL.md | Updates guidance to mention assertion output and bundle exec rake. |
| .claude/skills/add-rubyzen-tests/SKILL.md | Updates guidance to include Minitest assertion tests under test/. |
Copilot started reviewing on behalf of
Stelios Frantzeskakis (steliosfran)
June 3, 2026 09:39
View session
Eric Silverberg (esilverberg)
approved these changes
Jun 3, 2026
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.
What changed and why
Checklist
bundle exec rakepasses locally (runs both the RSpec and Minitest suites)Summary
Adds first-class Minitest support, so Rubyzen lint rules can be written with either RSpec or Minitest. Both frameworks share the same engine and behave identically (including
allowlist:/baseline:and the rich failure messages).Closes #29.
What's new
require 'rubyzen/minitest'addsassert_zen_empty,assert_zen_true, andassert_zen_false, the equivalent of thezen_empty/zen_true/zen_falsematchers.require 'rubyzen'— core Rubyzen APIs (no test framework)require 'rubyzen/rspec'— core + RSpec matchersrequire 'rubyzen/minitest'— core + Minitest assertionsrspecis now a development dependency, not a runtime one, so that Minitest users won't have to depend on RSpec.CHANGELOG.md).RSpec users will need to replace
require 'rubyzen'withrequire 'rubyzen/rspec':Individual spec files remain unchanged.