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

Function TestYML

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

Source from the content-addressed store, hash-verified

545}
546
547func TestYML(t *testing.T) {
548 v := New()
549 v.SetConfigType("yaml")
550
551 // Read the YAML data into Viper configuration
552 require.NoError(t, v.ReadConfig(bytes.NewBuffer(yamlExample)), "Error reading YAML data")
553
554 assert.Equal(t, "steve", v.Get("name"))
555}
556
557func TestJSON(t *testing.T) {
558 v := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
SetConfigTypeMethod · 0.80
ReadConfigMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected