Files
docker-cli/components/cli/internal/test/testutil/assert.go
T
Daniel Nephin ad1a2c9e1d Automated migration
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 39c2ca57c1
Component: cli
2018-03-05 19:41:17 -05:00

16 lines
502 B
Go

package testutil
import (
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
// ErrorContains checks that the error is not nil, and contains the expected
// substring.
// TODO: replace with testify if https://github.com/stretchr/testify/pull/486
// is accepted.
func ErrorContains(t assert.TestingT, err error, expectedError string) {
assert.Assert(t, is.ErrorContains(err, ""))
assert.Check(t, is.Contains(err.Error(), expectedError))
}