MCPcopy Index your code
hub / github.com/docker/cli / TestRequiresNoArgs

Function TestRequiresNoArgs

cli/required_test.go:12–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func 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
31func TestRequiresMinArgs(t *testing.T) {
32 testCases := []testCase{

Callers

nothing calls this directly

Calls 2

newDummyCommandFunction · 0.85
SetArgsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…