feat: add mock_file_checks_guard() for multi-check scoped mocking#111
Draft
Koan-Bot wants to merge 1 commit into
Draft
feat: add mock_file_checks_guard() for multi-check scoped mocking#111Koan-Bot wants to merge 1 commit into
Koan-Bot wants to merge 1 commit into
Conversation
Adds a convenience function that mocks multiple specific file checks at once and returns a single guard object for automatic cleanup. Fills the API gap between mock_file_check_guard (single check) and mock_all_file_checks (all checks) — common in tests that need 2-5 specific checks mocked together. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Adds
mock_file_checks_guard()— mock multiple specific file checks at once, get one guard back.Why
Current API has a gap between
mock_file_check_guard(single check) andmock_all_file_checks(all checks). Tests that need 2–5 specific checks mocked together require managing multiple guard objects or manual cleanup. This fills that gap with a single call.How
Pure Perl convenience wrapper: iterates check/CODE pairs, calls
mock_file_checkfor each, returns oneGuardobject covering all checks. No XS changes.Testing
16 new tests covering: basic multi-check setup/teardown, FALLBACK_TO_REAL_OP passthrough, guard cancel, error cases (odd args, empty args, duplicate mock), mixed dash/no-dash syntax. Full test suite passes.
🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 151 insertions(+), 1 deletion(-)
Code scan: clean
Tests: passed (0 Tests)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline