summaryrefslogtreecommitdiffstats
path: root/hugolib/testhelpers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/testhelpers_test.go')
-rw-r--r--hugolib/testhelpers_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/hugolib/testhelpers_test.go b/hugolib/testhelpers_test.go
index 67e2caee9..eace35c97 100644
--- a/hugolib/testhelpers_test.go
+++ b/hugolib/testhelpers_test.go
@@ -277,9 +277,14 @@ func (s *sitesBuilder) WithSimpleConfigFile() *sitesBuilder {
func (s *sitesBuilder) WithSimpleConfigFileAndBaseURL(baseURL string) *sitesBuilder {
s.T.Helper()
- config := fmt.Sprintf("baseURL = %q", baseURL)
+ return s.WithSimpleConfigFileAndSettings(map[string]interface{}{"baseURL": baseURL})
+}
- config = config + commonConfigSections
+func (s *sitesBuilder) WithSimpleConfigFileAndSettings(settings interface{}) *sitesBuilder {
+ s.T.Helper()
+ var buf bytes.Buffer
+ parser.InterfaceToConfig(settings, metadecoders.TOML, &buf)
+ config := buf.String() + commonConfigSections
return s.WithConfigFile("toml", config)
}