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

Function TestSetConfigNameClearsFileCache

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

Source from the content-addressed store, hash-verified

2187}
2188
2189func TestSetConfigNameClearsFileCache(t *testing.T) {
2190 v := New()
2191 v.SetConfigFile("/tmp/config.yaml")
2192 v.SetConfigName("default")
2193 f, err := v.getConfigFile()
2194 require.Error(t, err, "config file cache should have been cleared")
2195 assert.Empty(t, f)
2196}
2197
2198func TestShadowedNestedValue(t *testing.T) {
2199 v := New()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
SetConfigFileMethod · 0.80
SetConfigNameMethod · 0.80
getConfigFileMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected