summaryrefslogtreecommitdiffstats
path: root/hugolib/config_test.go
diff options
context:
space:
mode:
authorGarry McNulty <garrmcnu@gmail.com>2018-07-15 14:35:41 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-15 16:13:48 +0200
commit38204c4ab6fa2aa2ab8bd06ddb3e07b66e5f9646 (patch)
tree70b712eea09df942d76952868a30b940e9547657 /hugolib/config_test.go
parent2f2bc7ff70b90fb11580cc092ef3883bf68d8ad7 (diff)
hugolib: Only set 'allThemes' if there are themes in the config file
When the 'allThemes' configuration setting is read, it will panic if there are no themes. This was a regression introduced in Hugo 0.42. Also updated a unit test to check for this. Fixes #4851
Diffstat (limited to 'hugolib/config_test.go')
-rw-r--r--hugolib/config_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/hugolib/config_test.go b/hugolib/config_test.go
index 2fa26d4f3..0fe692805 100644
--- a/hugolib/config_test.go
+++ b/hugolib/config_test.go
@@ -42,6 +42,8 @@ func TestLoadConfig(t *testing.T) {
assert.Equal("side", cfg.GetString("paginatePath"))
// default
assert.Equal("layouts", cfg.GetString("layoutDir"))
+ // no themes
+ assert.False(cfg.IsSet("allThemes"))
}
func TestLoadMultiConfig(t *testing.T) {