Skip to content

Commit

Permalink
Fix assert to account for updated error message
Browse files Browse the repository at this point in the history
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
  • Loading branch information
carolynvs committed Oct 1, 2020
1 parent f74a606 commit 3e677ef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions driver/docker/docker_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/cnabio/cnab-go/bundle"
"github.com/cnabio/cnab-go/bundle/definition"
Expand Down Expand Up @@ -109,10 +110,8 @@ func TestDriver_ValidateImageDigestFail(t *testing.T) {
docker := &Driver{}

_, err := docker.Run(op)
assert.Error(t, err)
require.Error(t, err, "expected an error")
// Not asserting actual image digests to support arbitrary integration test images
assert.Contains(t, err.Error(),
fmt.Sprintf("content digest mismatch: image %s has digest", op.Image.Image))
assert.Contains(t, err.Error(),
fmt.Sprintf("but the value should be %s according to the bundle file", badDigest))
fmt.Sprintf("content digest mismatch: invocation image %s was defined in the bundle with the digest %s but no matching repoDigest was found upon inspecting the image", op.Image.Image, badDigest))
}

0 comments on commit 3e677ef

Please sign in to comment.