(t *testing.T)
| 61 | } |
| 62 | |
| 63 | func TestConfigRemoveContinueAfterError(t *testing.T) { |
| 64 | names := []string{"foo", "bar"} |
| 65 | var removedConfigs []string |
| 66 | |
| 67 | cli := test.NewFakeCli(&fakeClient{ |
| 68 | configRemoveFunc: func(_ context.Context, name string, _ client.ConfigRemoveOptions) (client.ConfigRemoveResult, error) { |
| 69 | removedConfigs = append(removedConfigs, name) |
| 70 | if name == "foo" { |
| 71 | return client.ConfigRemoveResult{}, errors.New("error removing config: " + name) |
| 72 | } |
| 73 | return client.ConfigRemoveResult{}, nil |
| 74 | }, |
| 75 | }) |
| 76 | |
| 77 | cmd := newConfigRemoveCommand(cli) |
| 78 | cmd.SetArgs(names) |
| 79 | cmd.SetOut(io.Discard) |
| 80 | cmd.SetErr(io.Discard) |
| 81 | assert.Error(t, cmd.Execute(), "error removing config: foo") |
| 82 | assert.Check(t, is.DeepEqual(names, removedConfigs)) |
| 83 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…