Skip to content

Commit 768fe51

Browse files
committed
Fix tests in light of default help handler
1 parent e0915f2 commit 768fe51

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ Serpent is designed for high-configurability. To us, that means providing
6666
many ways to configure the same value (env, YAML, flags, etc.) and keeping
6767
the code clean and testable as you scale the number of options.
6868

69-
7069
## More coming...
7170
This README is a stub for now. We'll better explain the design and usage
7271
of `serpent` in the future.

cmd_test.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,6 @@ func TestCommand(t *testing.T) {
146146
require.Equal(t, "HELLO", io.Stdout.String())
147147
})
148148

149-
t.Run("NoSubcommand", func(t *testing.T) {
150-
t.Parallel()
151-
i := cmd().Invoke(
152-
"na",
153-
)
154-
io := fakeIO(i)
155-
err := i.Run()
156-
require.Empty(t, io.Stdout.String())
157-
require.Error(t, err)
158-
})
159-
160149
t.Run("BadArgs", func(t *testing.T) {
161150
t.Parallel()
162151
i := cmd().Invoke(
@@ -550,13 +539,13 @@ func TestCommand_Help(t *testing.T) {
550539
}
551540
}
552541

553-
t.Run("NoHandler", func(t *testing.T) {
542+
t.Run("DefaultHandler", func(t *testing.T) {
554543
t.Parallel()
555544

556545
c := cmd()
557546
c.HelpHandler = nil
558547
err := c.Invoke("--help").Run()
559-
require.Error(t, err)
548+
require.NoError(t, err)
560549
})
561550

562551
t.Run("Long", func(t *testing.T) {

0 commit comments

Comments
 (0)