Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ktong committed Jan 29, 2024
1 parent 8810c00 commit 0262da8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion provider/file/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestFile_Load(t *testing.T) {
t.Parallel()

values, err := file.New(testcase.path, testcase.opts...).Load()
if err != nil {
if testcase.err != "" {
assert.True(t, strings.HasPrefix(err.Error(), testcase.err))
} else {
assert.NoError(t, err)
Expand Down
5 changes: 2 additions & 3 deletions provider/fs/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package fs_test
import (
"errors"
"io/fs"
"strings"
"testing"
"testing/fstest"

Expand Down Expand Up @@ -80,8 +79,8 @@ func TestFile_Load(t *testing.T) {
t.Parallel()

values, err := kfs.New(testcase.fs, testcase.path, testcase.opts...).Load()
if err != nil {
assert.True(t, strings.HasPrefix(err.Error(), testcase.err))
if testcase.err != "" {
assert.EqualError(t, err, testcase.err)
} else {
assert.NoError(t, err)
assert.Equal(t, testcase.expected, values)
Expand Down

0 comments on commit 0262da8

Please sign in to comment.