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

Function TestWriteHiddenFile

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

Source from the content-addressed store, hash-verified

2001}
2002
2003func TestWriteHiddenFile(t *testing.T) {
2004 v := New()
2005 fs := afero.NewMemMapFs()
2006 fs.Create(testutil.AbsFilePath(t, "/test/.config"))
2007 v.SetFs(fs)
2008
2009 v.SetConfigName(".config")
2010 v.SetConfigType("yaml")
2011 v.AddConfigPath("/test")
2012
2013 err := v.ReadInConfig()
2014 require.NoError(t, err)
2015
2016 err = v.WriteConfig()
2017 require.NoError(t, err)
2018}
2019
2020var yamlMergeExampleTgt = []byte(`
2021hello:

Callers

nothing calls this directly

Calls 8

AbsFilePathFunction · 0.92
NewFunction · 0.85
SetFsMethod · 0.80
SetConfigNameMethod · 0.80
SetConfigTypeMethod · 0.80
AddConfigPathMethod · 0.80
ReadInConfigMethod · 0.80
WriteConfigMethod · 0.80

Tested by

no test coverage detected