From 0594522560e470473af1d9a417c0b0f69e5fe368 Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Wed, 22 Sep 2021 20:17:20 +0200 Subject: [PATCH] test: fix failing tests on windows Signed-off-by: Mark Sagi-Kazar --- viper_test.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/viper_test.go b/viper_test.go index 2218917..464fce0 100644 --- a/viper_test.go +++ b/viper_test.go @@ -1808,8 +1808,6 @@ func TestWriteConfigDotEnv(t *testing.T) { } func TestSafeWriteConfig(t *testing.T) { - skipWindows(t) - v := New() fs := afero.NewMemMapFs() v.SetFs(fs) @@ -1818,7 +1816,7 @@ func TestSafeWriteConfig(t *testing.T) { v.SetConfigType("yaml") require.NoError(t, v.ReadConfig(bytes.NewBuffer(yamlExample))) require.NoError(t, v.SafeWriteConfig()) - read, err := afero.ReadFile(fs, "/test/c.yaml") + read, err := afero.ReadFile(fs, testutil.AbsFilePath(t, "/test/c.yaml")) require.NoError(t, err) assert.Equal(t, yamlWriteExpected, read) } @@ -1833,11 +1831,9 @@ func TestSafeWriteConfigWithMissingConfigPath(t *testing.T) { } func TestSafeWriteConfigWithExistingFile(t *testing.T) { - skipWindows(t) - v := New() fs := afero.NewMemMapFs() - fs.Create("/test/c.yaml") + fs.Create(testutil.AbsFilePath(t, "/test/c.yaml")) v.SetFs(fs) v.AddConfigPath("/test") v.SetConfigName("c") @@ -1874,11 +1870,9 @@ func TestSafeWriteConfigAsWithExistingFile(t *testing.T) { } func TestWriteHiddenFile(t *testing.T) { - skipWindows(t) - v := New() fs := afero.NewMemMapFs() - fs.Create("/test/.config") + fs.Create(testutil.AbsFilePath(t, "/test/.config")) v.SetFs(fs) v.SetConfigName(".config")