diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-03-21 09:35:15 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-04-08 13:26:17 +0200 |
commit | d070bdf10f14d233288f7318a4e9f7555f070a65 (patch) | |
tree | fff8d59f98bdab3027bb45c4e10ca88594332872 /hugolib/page_test.go | |
parent | b08193971a821fc27e549a73120c15e5e5186775 (diff) | |
download | hugo-d070bdf10f14d233288f7318a4e9f7555f070a65.tar.gz hugo-d070bdf10f14d233288f7318a4e9f7555f070a65.zip |
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
Diffstat (limited to 'hugolib/page_test.go')
-rw-r--r-- | hugolib/page_test.go | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go index d29a4f865..c16754cd9 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -23,7 +23,6 @@ import ( "time" "github.com/gohugoio/hugo/htesting" - "github.com/gohugoio/hugo/markup/asciidocext" "github.com/gohugoio/hugo/markup/rst" @@ -35,7 +34,6 @@ import ( "github.com/gohugoio/hugo/resources/page" "github.com/gohugoio/hugo/resources/resource" - "github.com/spf13/afero" "github.com/spf13/jwalterweatherman" qt "github.com/frankban/quicktest" @@ -1031,14 +1029,14 @@ func TestPageWithLastmodFromGitInfo(t *testing.T) { } c := qt.New(t) - // We need to use the OS fs for this. - cfg := config.New() - fs := hugofs.NewFrom(hugofs.Os, cfg) - fs.Destination = &afero.MemMapFs{} - wd, err := os.Getwd() c.Assert(err, qt.IsNil) + // We need to use the OS fs for this. + cfg := config.NewWithTestDefaults() + cfg.Set("workingDir", filepath.Join(wd, "testsite")) + fs := hugofs.NewFrom(hugofs.Os, cfg) + cfg.Set("frontmatter", map[string]any{ "lastmod": []string{":git", "lastmod"}, }) @@ -1060,8 +1058,6 @@ func TestPageWithLastmodFromGitInfo(t *testing.T) { cfg.Set("languages", langConfig) cfg.Set("enableGitInfo", true) - cfg.Set("workingDir", filepath.Join(wd, "testsite")) - b := newTestSitesBuilderFromDepsCfg(t, deps.DepsCfg{Fs: fs, Cfg: cfg}).WithNothingAdded() b.Build(BuildCfg{SkipRender: true}) @@ -1314,7 +1310,7 @@ func TestChompBOM(t *testing.T) { func TestPageWithEmoji(t *testing.T) { for _, enableEmoji := range []bool{true, false} { - v := config.New() + v := config.NewWithTestDefaults() v.Set("enableEmoji", enableEmoji) b := newTestSitesBuilder(t).WithViper(v) |