reg/vendor/github.com/docker/cli/internal/test/testutil/assert.go
Jess Frazelle 3834c605e5
update deps
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-03-06 10:32:47 -05:00

16 lines
439 B
Go

package testutil
import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// 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 require.TestingT, err error, expectedError string) {
require.Error(t, err)
assert.Contains(t, err.Error(), expectedError)
}