mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
a0c9089971
Signed-off-by: Daniel Nephin <dnephin@docker.com>
13 lines
345 B
Go
13 lines
345 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.
|
|
func ErrorContains(t require.TestingT, err error, expectedError string) {
|
|
require.Error(t, err)
|
|
assert.Contains(t, err.Error(), expectedError)
|
|
}
|