(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func TestReadMultiConfig(t *testing.T) { |
| 73 | t.Parallel() |
| 74 | a := assertions.New(t) |
| 75 | |
| 76 | _, filename, _, _ := runtime.Caller(0) |
| 77 | |
| 78 | first := path.Join(filepath.Dir(filename), "first.yml") |
| 79 | second := path.Join(filepath.Dir(filename), "second.yml") |
| 80 | _ = second |
| 81 | |
| 82 | defaults := &multiFileConfig{} |
| 83 | |
| 84 | mgr := InitializeWithDefaults("empty", "empty", defaults) |
| 85 | a.So(mgr, should.NotBeNil) |
| 86 | |
| 87 | err := mgr.Parse("--config", first, "--config", second) |
| 88 | a.So(err, should.BeNil) |
| 89 | |
| 90 | err = mgr.ReadInConfig() |
| 91 | a.So(err, should.BeNil) |
| 92 | |
| 93 | res := new(multiFileConfig) |
| 94 | err = mgr.Unmarshal(res) |
| 95 | a.So(err, should.BeNil) |
| 96 | |
| 97 | a.So(res.Foo, should.Resemble, "10") |
| 98 | a.So(res.Bar, should.Resemble, map[string]string{ |
| 99 | "a": "baz", |
| 100 | "b": "quu", |
| 101 | "c": "yo!", |
| 102 | }) |
| 103 | } |
nothing calls this directly
no test coverage detected