github.com/docker/docker-ce@v17.12.1-ce-rc2+incompatible/components/cli/internal/test/testutil/assert.go (about)

     1  package testutil
     2  
     3  import (
     4  	"github.com/stretchr/testify/assert"
     5  	"github.com/stretchr/testify/require"
     6  )
     7  
     8  // ErrorContains checks that the error is not nil, and contains the expected
     9  // substring.
    10  // TODO: replace with testify if https://github.com/stretchr/testify/pull/486
    11  // is accepted.
    12  func ErrorContains(t require.TestingT, err error, expectedError string) {
    13  	require.Error(t, err)
    14  	assert.Contains(t, err.Error(), expectedError)
    15  }