Skip to content

Increment Minitest assertion count in assert_schema_conform methods#473

Merged
geemus merged 2 commits intointeragent:masterfrom
ursm:increment-minitest-assertion-count
Apr 12, 2026
Merged

Increment Minitest assertion count in assert_schema_conform methods#473
geemus merged 2 commits intointeragent:masterfrom
ursm:increment-minitest-assertion-count

Conversation

@ursm
Copy link
Copy Markdown
Contributor

@ursm ursm commented Apr 6, 2026

Summary

  • assert_request_schema_confirm and assert_response_schema_confirm did not call Minitest's assert, so they were not counted as assertions. This caused Minitest to emit "Test is missing assertions" warnings when these were the only assertions in a test.
  • Added assert true after successful validation to increment the assertion counter, guarded by respond_to?(:assertions) so it is a no-op in non-Minitest environments (e.g. RSpec).

Test plan

  • Existing tests pass (test/test/methods_test.rb, test/test/methods_new_version_test.rb)
  • Verify in a Minitest project that the warning no longer appears

🤖 Generated with Claude Code

assert_request_schema_confirm and assert_response_schema_confirm did
not call Minitest's assert, so they were not counted as assertions.
This caused Minitest to emit "Test is missing assertions" warnings
when these were the only assertions in a test.

Call `assert true` after successful validation to increment the
assertion counter. The call is guarded by `respond_to?(:assertions)`
so it is a no-op in non-Minitest environments (e.g. RSpec).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@geemus geemus left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

Comment thread lib/committee/test/methods.rb
- Explain why increment_assertion_count exists so future readers
  understand the Minitest assertion counting nuance.
- Add tests that verify assert_request_schema_confirm and
  assert_response_schema_confirm each bump the Minitest assertion
  count on success, guarding against regression.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@geemus geemus left a comment

Choose a reason for hiding this comment

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

lgtm

@geemus geemus merged commit 33534fc into interagent:master Apr 12, 2026
9 checks passed
@ydah
Copy link
Copy Markdown
Member

ydah commented Apr 16, 2026

@ursm - released in v5.6.3

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.

3 participants