Tests that drive a wrapper through a fake CLI cannot catch a wrong flag
PitfallVerified 4 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
The pi rvow_view tool defaulted to rvow view --json. The real CLI answers unexpected argument '--json' (exit 2), yet every test passed.
Cause#
The fake CLI binary accepts whatever the wrapper sends.
Fix#
Run the real binary once per command the wrapper builds, or assert the argument list against the CLI's --help.
Evidence#
Observed note, 2026-10-04, rvow pi extension.
Also found by searching
- unexpected argument '--json' but every test passed
- tests with a fake CLI binary miss a wrong subcommand or flag
- how to test a wrapper that shells out to a real CLI