modify error message to original

This commit is contained in:
Yigit Demirbas
2023-09-27 12:52:09 +02:00
parent cb5b241715
commit 0d854a5144
3 changed files with 3 additions and 3 deletions

View File

@@ -103,5 +103,5 @@ func TestAddResourceFileNotFound(t *testing.T) {
args := []string{resourceFileName}
err := cmd.RunE(cmd, args)
assert.EqualError(t, err, "pattern "+resourceFileName+" has no match: must build at directory: not a valid directory: '"+resourceFileName+"' doesn't exist")
assert.EqualError(t, err, resourceFileName+" has no match: must build at directory: not a valid directory: '"+resourceFileName+"' doesn't exist")
}

View File

@@ -55,7 +55,7 @@ func GlobPatternsWithLoader(fSys filesys.FileSystem, ldr ifc.Loader, patterns []
loader, err := ldr.New(pattern)
if err != nil {
return nil, fmt.Errorf("pattern %s has no match: %w", pattern, err)
return nil, fmt.Errorf("%s has no match: %w", pattern, err)
}
result = append(result, pattern)

View File

@@ -76,7 +76,7 @@ func TestGlobPatternsWithLoaderRemoteFile(t *testing.T) {
invalidURL := "http://invalid"
resources, err = GlobPatternsWithLoader(fSys, ldr, []string{invalidURL}, false)
require.Error(t, err, "expected error but did not receive one")
require.Equal(t, "pattern "+invalidURL+" has no match: "+invalidURL+" not exist", err.Error(), "unexpected load error")
require.Equal(t, invalidURL+" has no match: "+invalidURL+" not exist", err.Error(), "unexpected load error")
require.Equal(t, 0, len(resources), "incorrect resources")
// test load unreachable remote file with skipped verification