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

Function TestSafeWriteConfigAsWithExistingFile

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

Source from the content-addressed store, hash-verified

1990}
1991
1992func TestSafeWriteConfigAsWithExistingFile(t *testing.T) {
1993 v := New()
1994 fs := afero.NewMemMapFs()
1995 fs.Create("/test/c.yaml")
1996 v.SetFs(fs)
1997 err := v.SafeWriteConfigAs("/test/c.yaml")
1998 require.Error(t, err)
1999 _, ok := err.(ConfigFileAlreadyExistsError)
2000 assert.True(t, ok, "Expected ConfigFileAlreadyExistsError")
2001}
2002
2003func TestWriteHiddenFile(t *testing.T) {
2004 v := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
SetFsMethod · 0.80
SafeWriteConfigAsMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…