From d070bdf10f14d233288f7318a4e9f7555f070a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 21 Mar 2022 09:35:15 +0100 Subject: Rework the Destination filesystem to make --renderStaticToDisk work See #9626 --- hugolib/page_test.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'hugolib/page_test.go') 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) -- cgit v1.2.3