diff --git a/viper_test.go b/viper_test.go index 080d0c4..c371c07 100644 --- a/viper_test.go +++ b/viper_test.go @@ -1742,6 +1742,23 @@ func TestSafeWriteConfigAsWithExistingFile(t *testing.T) { assert.True(t, ok, "Expected ConfigFileAlreadyExistsError") } +func TestWriteHiddenFile(t *testing.T) { + v := New() + fs := afero.NewMemMapFs() + fs.Create("/test/.config") + v.SetFs(fs) + + v.SetConfigName(".config") + v.SetConfigType("yaml") + v.AddConfigPath("/test") + + err := v.ReadInConfig() + require.NoError(t, err) + + err = v.WriteConfig() + require.NoError(t, err) +} + var yamlMergeExampleTgt = []byte(` hello: pop: 37890