(t *testing.T)
| 14 | ) |
| 15 | |
| 16 | func TestNewInspectCommandErrors(t *testing.T) { |
| 17 | testCases := []struct { |
| 18 | name string |
| 19 | args []string |
| 20 | expectedError string |
| 21 | }{ |
| 22 | { |
| 23 | name: "wrong-args", |
| 24 | args: []string{}, |
| 25 | expectedError: "requires at least 1 argument", |
| 26 | }, |
| 27 | } |
| 28 | for _, tc := range testCases { |
| 29 | t.Run(tc.name, func(t *testing.T) { |
| 30 | cmd := newInspectCommand(test.NewFakeCli(&fakeClient{})) |
| 31 | cmd.SetOut(io.Discard) |
| 32 | cmd.SetErr(io.Discard) |
| 33 | cmd.SetArgs(tc.args) |
| 34 | assert.ErrorContains(t, cmd.Execute(), tc.expectedError) |
| 35 | }) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func TestNewInspectCommandSuccess(t *testing.T) { |
| 40 | imageInspectInvocationCount := 0 |
nothing calls this directly
no test coverage detected
searching dependent graphs…