allow a forced unstub mode without plans validation - #49
Open
e-picas wants to merge 1 commit into
Open
Conversation
jgrigg
added a commit
to jgrigg/bats-mock
that referenced
this pull request
Aug 22, 2026
--allow-missing only suppresses the "never stubbed" case; it does not forgive an unfulfilled plan on a stub that does exist. That's what upstream's "forced unstub mode without plans validation" (jasonkarns#37/jasonkarns#49) asks for, and what --force now provides. Upstream implements this as a second positional argument (unstub <cmd> true); this fork uses a named flag instead, matching the existing --allow-missing convention. Flags parse in either order via a small while-loop. --force skips calling binstub in END mode entirely, matching upstream's actual mechanism -- so unlike every other unstub path, a forced unstub produces no debug() output. Cleanup still happens unconditionally.
jgrigg
added a commit
to jgrigg/bats-mock
that referenced
this pull request
Aug 22, 2026
feat: add unstub --force, closing upstream jasonkarns#37/jasonkarns#49
This was referenced Aug 22, 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.
Introduce the ability to "force" an unstub without verficiation of the stub plans. The idea is to not fail if some invocations are delcared for the stubbed command but not used.
It adds a new parameter to the
unstubfunction:unstub <cmd> [forced=false].The default behaviour is to keep the validation and fail if some plans were not called.
Dependencies before to merge: