git grep -l -P '^\s+assert\.Check\(t, ' | \
xargs perl -pi -e 's/^(\s+assert)\.Check(\(t, (?!is).*(\.Execute\(|\.Set\(|\.Write\(|\.Close\(|\.Untar\(|\.WriteFile\(|Validate\().*\)$)/\1.NilError\2/'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
23 lines
644 B
Go
23 lines
644 B
Go
package system
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/docker/cli/internal/test"
|
|
"github.com/gotestyourself/gotestyourself/assert"
|
|
is "github.com/gotestyourself/gotestyourself/assert/cmp"
|
|
)
|
|
|
|
func TestPrunePromptPre131DoesNotIncludeBuildCache(t *testing.T) {
|
|
cli := test.NewFakeCli(&fakeClient{version: "1.30"})
|
|
cmd := newPruneCommand(cli)
|
|
assert.NilError(t, cmd.Execute())
|
|
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] `
|
|
assert.Check(t, is.Equal(expected, cli.OutBuffer().String()))
|
|
|
|
}
|