MCPcopy
hub / github.com/spf13/viper / TestSafeWriteConfigWithMissingConfigPath

Function TestSafeWriteConfigWithMissingConfigPath

viper_test.go:1957–1964  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1955}
1956
1957func TestSafeWriteConfigWithMissingConfigPath(t *testing.T) {
1958 v := New()
1959 fs := afero.NewMemMapFs()
1960 v.SetFs(fs)
1961 v.SetConfigName("c")
1962 v.SetConfigType("yaml")
1963 require.EqualError(t, v.SafeWriteConfig(), "missing configuration for 'configPath'")
1964}
1965
1966func TestSafeWriteConfigWithExistingFile(t *testing.T) {
1967 v := New()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
SetFsMethod · 0.80
SetConfigNameMethod · 0.80
SetConfigTypeMethod · 0.80
SafeWriteConfigMethod · 0.80

Tested by

no test coverage detected