mirror of
https://github.com/docker/compose.git
synced 2025-07-22 13:14:29 +02:00
Fix the rm test without force
mutlierror didn't append an `Error:` if there is only one error...
This commit is contained in:
parent
37a547de59
commit
f44d29f4df
@ -95,7 +95,7 @@ func Append(err error, errs ...error) *Error {
|
|||||||
|
|
||||||
func listErrorFunc(errs []error) string {
|
func listErrorFunc(errs []error) string {
|
||||||
if len(errs) == 1 {
|
if len(errs) == 1 {
|
||||||
return errs[0].Error()
|
return "Error: " + errs[0].Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
messages := make([]string, len(errs))
|
messages := make([]string, len(errs))
|
||||||
|
@ -61,5 +61,5 @@ func TestErrorOrNil(t *testing.T) {
|
|||||||
|
|
||||||
err = Append(err, errors.New("error"))
|
err = Append(err, errors.New("error"))
|
||||||
e := err.ErrorOrNil()
|
e := err.ErrorOrNil()
|
||||||
assert.Error(t, e, "error")
|
assert.Error(t, e, "Error: error")
|
||||||
}
|
}
|
||||||
|
@ -268,7 +268,7 @@ func TestContainerRun(t *testing.T) {
|
|||||||
t.Run("rm a running container", func(t *testing.T) {
|
t.Run("rm a running container", func(t *testing.T) {
|
||||||
res := c.RunDockerCmd("rm", container)
|
res := c.RunDockerCmd("rm", container)
|
||||||
res.Assert(t, icmd.Expected{
|
res.Assert(t, icmd.Expected{
|
||||||
Err: fmt.Sprintf("Error: You cannot remove a running container %s. Stop the container before attempting removal or force remove\n", container),
|
Err: fmt.Sprintf("Error: you cannot remove a running container %s. Stop the container before attempting removal or force remove", container),
|
||||||
ExitCode: 1,
|
ExitCode: 1,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user