Skip to content

Commit 26c7ac5

Browse files
committed
Tighten plan/2607191917's TestSetInitUsage task wording
Round-2 code review found the task offered a dead alternative: setInitUsage's closure hardcodes os.Stderr with no writer parameter, so "redirecting the closure's writer" was never actually an option. Point at captureStderr directly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Req4a3SADus6KRYrmYqKg
1 parent 5d670e2 commit 26c7ac5

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

plan/2607191917_arch-fix-printinitcatalog-unit-test.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ method — both are helpers `runInit` wires up.
6868
2. Add `TestSetInitUsage` in
6969
[init_unit_test.go](../cmd/mdsmith/init_unit_test.go),
7070
building a `*pflag.FlagSet`, calling `setInitUsage`, then
71-
invoking `fs.Usage()` with a captured `os.Stderr` (or by
72-
redirecting the closure's writer, whichever the existing
73-
test helpers in this file support) and asserting the
74-
printed text names `--starter`, `--from-markdownlint`,
75-
`--add`, `--force`, and `--list`.
71+
invoking `fs.Usage()` inside `captureStderr` (the closure
72+
writes to the hardcoded `os.Stderr`, so this is the only
73+
viable capture point — see the other `runInit` tests in
74+
this file for the pattern) and asserting the printed text
75+
names `--starter`, `--from-markdownlint`, `--add`,
76+
`--force`, and `--list`.
7677
3. Leave the existing e2e `--list` and `--help` tests in
7778
place — they still cover the full CLI dispatch path — but
7879
do not duplicate the content assertions there beyond a

0 commit comments

Comments
 (0)