| 192 | } |
| 193 | |
| 194 | func TestVolumePrunePromptTerminate(t *testing.T) { |
| 195 | ctx, cancel := context.WithCancel(context.Background()) |
| 196 | t.Cleanup(cancel) |
| 197 | |
| 198 | cli := test.NewFakeCli(&fakeClient{ |
| 199 | volumePruneFunc: func(options client.VolumePruneOptions) (client.VolumePruneResult, error) { |
| 200 | return client.VolumePruneResult{}, errors.New("fakeClient volumePruneFunc should not be called") |
| 201 | }, |
| 202 | }) |
| 203 | |
| 204 | cmd := newPruneCommand(cli) |
| 205 | cmd.SetArgs([]string{}) |
| 206 | cmd.SetOut(io.Discard) |
| 207 | cmd.SetErr(io.Discard) |
| 208 | test.TerminatePrompt(ctx, t, cmd, cli) |
| 209 | golden.Assert(t, cli.OutBuffer().String(), "volume-prune-terminate.golden") |
| 210 | } |