aboutsummaryrefslogtreecommitdiffhomepage
path: root/helpers/testhelpers_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2022-03-21 09:35:15 +0100
committerBjørn Erik Pedersen <[email protected]>2022-04-08 13:26:17 +0200
commitd070bdf10f14d233288f7318a4e9f7555f070a65 (patch)
treefff8d59f98bdab3027bb45c4e10ca88594332872 /helpers/testhelpers_test.go
parentb08193971a821fc27e549a73120c15e5e5186775 (diff)
downloadhugo-d070bdf10f14d233288f7318a4e9f7555f070a65.tar.gz
hugo-d070bdf10f14d233288f7318a4e9f7555f070a65.zip
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
Diffstat (limited to 'helpers/testhelpers_test.go')
-rw-r--r--helpers/testhelpers_test.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/helpers/testhelpers_test.go b/helpers/testhelpers_test.go
index 1d1bf73ec..00be3db25 100644
--- a/helpers/testhelpers_test.go
+++ b/helpers/testhelpers_test.go
@@ -17,9 +17,8 @@ func newTestPathSpec(fs *hugofs.Fs, v config.Provider) *PathSpec {
}
func newTestDefaultPathSpec(configKeyValues ...any) *PathSpec {
- v := config.New()
- fs := hugofs.NewMem(v)
cfg := newTestCfg()
+ fs := hugofs.NewMem(cfg)
for i := 0; i < len(configKeyValues); i += 2 {
cfg.Set(configKeyValues[i].(string), configKeyValues[i+1])
@@ -28,15 +27,7 @@ func newTestDefaultPathSpec(configKeyValues ...any) *PathSpec {
}
func newTestCfg() config.Provider {
- v := config.New()
- v.Set("contentDir", "content")
- v.Set("dataDir", "data")
- v.Set("i18nDir", "i18n")
- v.Set("layoutDir", "layouts")
- v.Set("assetDir", "assets")
- v.Set("resourceDir", "resources")
- v.Set("publishDir", "public")
- v.Set("archetypeDir", "archetypes")
+ v := config.NewWithTestDefaults()
langs.LoadLanguageSettings(v, nil)
langs.LoadLanguageSettings(v, nil)
mod, err := modules.CreateProjectModule(v)
@@ -49,7 +40,7 @@ func newTestCfg() config.Provider {
}
func newTestContentSpec() *ContentSpec {
- v := config.New()
+ v := config.NewWithTestDefaults()
spec, err := NewContentSpec(v, loggers.NewErrorLogger(), afero.NewMemMapFs(), nil)
if err != nil {
panic(err)