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

Function TestFinders

finder_test.go:19–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func TestFinders(t *testing.T) {
20 finder := Finders(
21 finderStub{
22 results: []string{
23 "/home/user/.viper.yaml",
24 },
25 },
26 finderStub{
27 results: []string{
28 "/etc/viper/config.yaml",
29 },
30 },
31 )
32
33 results, err := finder.Find(afero.NewMemMapFs())
34 require.NoError(t, err)
35
36 expected := []string{
37 "/home/user/.viper.yaml",
38 "/etc/viper/config.yaml",
39 }
40
41 assert.Equal(t, expected, results)
42}

Callers

nothing calls this directly

Calls 2

FindersFunction · 0.85
FindMethod · 0.65

Tested by

no test coverage detected