(t *testing.T)
| 1964 | } |
| 1965 | |
| 1966 | func TestSafeWriteConfigWithExistingFile(t *testing.T) { |
| 1967 | v := New() |
| 1968 | fs := afero.NewMemMapFs() |
| 1969 | fs.Create(testutil.AbsFilePath(t, "/test/c.yaml")) |
| 1970 | v.SetFs(fs) |
| 1971 | v.AddConfigPath("/test") |
| 1972 | v.SetConfigName("c") |
| 1973 | v.SetConfigType("yaml") |
| 1974 | err := v.SafeWriteConfig() |
| 1975 | require.Error(t, err) |
| 1976 | _, ok := err.(ConfigFileAlreadyExistsError) |
| 1977 | assert.True(t, ok, "Expected ConfigFileAlreadyExistsError") |
| 1978 | } |
| 1979 | |
| 1980 | func TestSafeWriteAsConfig(t *testing.T) { |
| 1981 | v := New() |
nothing calls this directly
no test coverage detected