mirror of
https://github.com/spf13/viper
synced 2024-12-22 11:37:02 +00:00
test: fix test on windows
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
This commit is contained in:
parent
796fe3d4a4
commit
92e330ea77
1 changed files with 5 additions and 5 deletions
|
@ -368,14 +368,14 @@ func TestGetConfigFile(t *testing.T) {
|
|||
t.Run("using a finder", func(t *testing.T) {
|
||||
fs := afero.NewMemMapFs()
|
||||
|
||||
err := fs.Mkdir("/etc/viper", 0o777)
|
||||
err := fs.Mkdir(testutil.AbsFilePath(t, "/etc/viper"), 0o777)
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = fs.Create("/etc/viper/config.yaml")
|
||||
_, err = fs.Create(testutil.AbsFilePath(t, "/etc/viper/config.yaml"))
|
||||
require.NoError(t, err)
|
||||
|
||||
finder := locafero.Finder{
|
||||
Paths: []string{"/etc/viper"},
|
||||
Paths: []string{testutil.AbsFilePath(t, "/etc/viper")},
|
||||
Names: locafero.NameWithExtensions("config", SupportedExts...),
|
||||
Type: locafero.FileTypeFile,
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ func TestGetConfigFile(t *testing.T) {
|
|||
v.SetConfigName("not-config")
|
||||
|
||||
filename, err := v.getConfigFile()
|
||||
assert.Equal(t, "/etc/viper/config.yaml", filename)
|
||||
assert.Equal(t, testutil.AbsFilePath(t, "/etc/viper/config.yaml"), testutil.AbsFilePath(t, filename))
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
@ -460,7 +460,7 @@ func TestReadInConfig(t *testing.T) {
|
|||
file.Close()
|
||||
|
||||
finder := locafero.Finder{
|
||||
Paths: []string{"/etc/viper"},
|
||||
Paths: []string{testutil.AbsFilePath(t, "/etc/viper")},
|
||||
Names: locafero.NameWithExtensions("config", SupportedExts...),
|
||||
Type: locafero.FileTypeFile,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue