2017-07-15 19:03:17 -04:00
|
|
|
package system
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2017-08-21 16:30:09 -04:00
|
|
|
"github.com/docker/cli/internal/test"
|
2018-06-08 12:24:26 -04:00
|
|
|
"gotest.tools/assert"
|
|
|
|
is "gotest.tools/assert/cmp"
|
2017-07-15 19:03:17 -04:00
|
|
|
)
|
|
|
|
|
2017-12-20 17:54:31 -05:00
|
|
|
func TestPrunePromptPre131DoesNotIncludeBuildCache(t *testing.T) {
|
2017-07-15 19:03:17 -04:00
|
|
|
cli := test.NewFakeCli(&fakeClient{version: "1.30"})
|
2017-07-18 09:26:45 -04:00
|
|
|
cmd := newPruneCommand(cli)
|
2018-03-06 15:13:00 -05:00
|
|
|
assert.NilError(t, cmd.Execute())
|
2017-12-20 17:54:31 -05:00
|
|
|
expected := `WARNING! This will remove:
|
|
|
|
- all stopped containers
|
|
|
|
- all networks not used by at least one container
|
|
|
|
- all dangling images
|
|
|
|
Are you sure you want to continue? [y/N] `
|
2018-03-05 18:53:52 -05:00
|
|
|
assert.Check(t, is.Equal(expected, cli.OutBuffer().String()))
|
2017-12-20 17:54:31 -05:00
|
|
|
|
2017-07-15 19:03:17 -04:00
|
|
|
}
|