diff options
author | Johan Gielstra <jgielstra@users.noreply.github.com> | 2017-08-09 13:13:02 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-08-09 20:13:02 +0200 |
commit | 0f9f73cce5c3f1f05be20bcf1d23b2332623d7f9 (patch) | |
tree | d269c649a44e3e6b801d4fb80c1345493ff2af99 /hugolib/config_test.go | |
parent | c8257f8b726478ca70dc8984cdcc17b31e4bdc0c (diff) |
Add support for multiple config files via --config a.toml,b.toml,c.toml
Diffstat (limited to 'hugolib/config_test.go')
-rw-r--r-- | hugolib/config_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/hugolib/config_test.go b/hugolib/config_test.go index 780e5c33d..874416b9d 100644 --- a/hugolib/config_test.go +++ b/hugolib/config_test.go @@ -41,3 +41,27 @@ func TestLoadConfig(t *testing.T) { // default assert.Equal(t, "layouts", cfg.GetString("layoutDir")) } +func TestLoadMultiConfig(t *testing.T) { + t.Parallel() + + // Add a random config variable for testing. + // side = page in Norwegian. + configContentBase := ` + DontChange = "same" + PaginatePath = "side" + ` + configContentSub := ` + PaginatePath = "top" + ` + mm := afero.NewMemMapFs() + + writeToFs(t, mm, "base.toml", configContentBase) + + writeToFs(t, mm, "override.toml", configContentSub) + + cfg, err := LoadConfig(mm, "", "base.toml,override.toml") + require.NoError(t, err) + + assert.Equal(t, "top", cfg.GetString("paginatePath")) + assert.Equal(t, "same", cfg.GetString("DontChange")) +} |