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

Function TestAutoEnv

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

Source from the content-addressed store, hash-verified

695}
696
697func TestAutoEnv(t *testing.T) {
698 v := New()
699
700 v.AutomaticEnv()
701
702 t.Setenv("FOO_BAR", "13")
703
704 assert.Equal(t, "13", v.Get("foo_bar"))
705}
706
707func TestAutoEnvWithPrefix(t *testing.T) {
708 v := New()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
AutomaticEnvMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected