(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestRequiresNoArgs(t *testing.T) { |
| 13 | testCases := []testCase{ |
| 14 | { |
| 15 | validateFunc: NoArgs, |
| 16 | expectedError: "no error", |
| 17 | }, |
| 18 | { |
| 19 | args: []string{"foo"}, |
| 20 | validateFunc: NoArgs, |
| 21 | expectedError: "accepts no arguments", |
| 22 | }, |
| 23 | } |
| 24 | for _, tc := range testCases { |
| 25 | cmd := newDummyCommand(tc.validateFunc) |
| 26 | cmd.SetArgs(tc.args) |
| 27 | assert.ErrorContains(t, cmd.Execute(), tc.expectedError) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | func TestRequiresMinArgs(t *testing.T) { |
| 32 | testCases := []testCase{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…