Skip to content

[GH-7502] Add Minitest support#32

Merged
Stelios Frantzeskakis (steliosfran) merged 3 commits into
mainfrom
7502-add-minitest-support-in-rubyzen
Jun 3, 2026
Merged

[GH-7502] Add Minitest support#32
Stelios Frantzeskakis (steliosfran) merged 3 commits into
mainfrom
7502-add-minitest-support-in-rubyzen

Conversation

@steliosfran

Copy link
Copy Markdown
Collaborator

What changed and why

Checklist

  • Tests are added or updated for the changes
  • YARD docs are added or updated for the changes
  • bundle exec rake passes 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

  • Minitest adapterrequire 'rubyzen/minitest' adds assert_zen_empty, assert_zen_true, and assert_zen_false, the equivalent of the zen_empty / zen_true / zen_false matchers.
  • Framework-agnostic entry points:
    • require 'rubyzen' — core Rubyzen APIs (no test framework)
    • require 'rubyzen/rspec' — core + RSpec matchers
    • require 'rubyzen/minitest' — core + Minitest assertions
  • rspec is now a development dependency, not a runtime one, so that Minitest users won't have to depend on RSpec.
  • Docs, agent skills, and CI updated to cover both frameworks
  • Version bumped to 0.2.0 (see CHANGELOG.md).

⚠️ Breaking change

RSpec users will need to replace require 'rubyzen' with require 'rubyzen/rspec':

- require 'rubyzen'
+ require 'rubyzen/rspec'

Individual spec files remain unchanged.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and rubyzen/minitest (assertions).
  • Adds Minitest assertions (assert_zen_empty, assert_zen_true, assert_zen_false) backed by shared ExpectationHelpers.
  • 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/.

Comment thread test/minitest_adapter_test.rb
Comment thread lib/rubyzen/rspec.rb
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 46 out of 46 changed files in this pull request and generated 2 comments.

Comment thread lib/rubyzen/minitest.rb
Comment thread lib/rubyzen/core.rb Outdated
@steliosfran Stelios Frantzeskakis (steliosfran) merged commit b02a0eb into main Jun 3, 2026
3 checks passed
@steliosfran Stelios Frantzeskakis (steliosfran) deleted the 7502-add-minitest-support-in-rubyzen branch June 3, 2026 10:35
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.

Minitest support

3 participants