Преглед изворни кода

Fix the rm test without force

mutlierror didn't append an `Error:` if there is only one error...
Djordje Lukic пре 5 година
родитељ
комит
f44d29f4df
3 измењених фајлова са 3 додато и 3 уклоњено
  1. 1 1
      multierror/multierror.go
  2. 1 1
      multierror/multierror_test.go
  3. 1 1
      tests/aci-e2e/e2e-aci_test.go

+ 1 - 1
multierror/multierror.go

@@ -95,7 +95,7 @@ func Append(err error, errs ...error) *Error {
 
 func listErrorFunc(errs []error) string {
 	if len(errs) == 1 {
-		return errs[0].Error()
+		return "Error: " + errs[0].Error()
 	}
 
 	messages := make([]string, len(errs))

+ 1 - 1
multierror/multierror_test.go

@@ -61,5 +61,5 @@ func TestErrorOrNil(t *testing.T) {
 
 	err = Append(err, errors.New("error"))
 	e := err.ErrorOrNil()
-	assert.Error(t, e, "error")
+	assert.Error(t, e, "Error: error")
 }

+ 1 - 1
tests/aci-e2e/e2e-aci_test.go

@@ -268,7 +268,7 @@ func TestContainerRun(t *testing.T) {
 	t.Run("rm a running container", func(t *testing.T) {
 		res := c.RunDockerCmd("rm", container)
 		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,
 		})
 	})