Added error message check to TestMandatoryVariableErrors test

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
This commit is contained in:
Arash Deshmeh 2018-02-21 17:02:38 -05:00
parent ce544823b6
commit e33bc48752
1 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package template
import ( import (
"testing" "testing"
"github.com/docker/cli/internal/test/testutil"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
@ -119,7 +120,8 @@ func TestMandatoryVariableErrors(t *testing.T) {
for _, tc := range testCases { for _, tc := range testCases {
_, err := Substitute(tc.template, defaultMapping) _, err := Substitute(tc.template, defaultMapping)
assert.Error(t, err) assert.Error(t, err)
assert.IsType(t, &InvalidTemplateError{tc.expectedError}, err) assert.IsType(t, &InvalidTemplateError{}, err)
testutil.ErrorContains(t, err, tc.expectedError)
} }
} }