full diff: c04dec1143...b45aa469ca
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
27 lines
632 B
Go
27 lines
632 B
Go
package builder
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"io"
|
|
"testing"
|
|
|
|
"github.com/docker/cli/internal/test"
|
|
"github.com/docker/docker/api/types/build"
|
|
)
|
|
|
|
func TestBuilderPromptTermination(t *testing.T) {
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
t.Cleanup(cancel)
|
|
|
|
cli := test.NewFakeCli(&fakeClient{
|
|
builderPruneFunc: func(ctx context.Context, opts build.CachePruneOptions) (*build.CachePruneReport, error) {
|
|
return nil, errors.New("fakeClient builderPruneFunc should not be called")
|
|
},
|
|
})
|
|
cmd := NewPruneCommand(cli)
|
|
cmd.SetOut(io.Discard)
|
|
cmd.SetErr(io.Discard)
|
|
test.TerminatePrompt(ctx, t, cmd, cli)
|
|
}
|