summaryrefslogtreecommitdiffstats
path: root/hugolib/filesystems/basefs_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-03-21 09:35:15 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-04-08 13:26:17 +0200
commitd070bdf10f14d233288f7318a4e9f7555f070a65 (patch)
treefff8d59f98bdab3027bb45c4e10ca88594332872 /hugolib/filesystems/basefs_test.go
parentb08193971a821fc27e549a73120c15e5e5186775 (diff)
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
Diffstat (limited to 'hugolib/filesystems/basefs_test.go')
-rw-r--r--hugolib/filesystems/basefs_test.go17
1 files changed, 7 insertions, 10 deletions
diff --git a/hugolib/filesystems/basefs_test.go b/hugolib/filesystems/basefs_test.go
index 32d1eef71..a729e63b1 100644
--- a/hugolib/filesystems/basefs_test.go
+++ b/hugolib/filesystems/basefs_test.go
@@ -75,7 +75,7 @@ func initConfig(fs afero.Fs, cfg config.Provider) error {
func TestNewBaseFs(t *testing.T) {
c := qt.New(t)
- v := config.New()
+ v := config.NewWithTestDefaults()
fs := hugofs.NewMem(v)
@@ -181,7 +181,7 @@ theme = ["atheme"]
}
func createConfig() config.Provider {
- v := config.New()
+ v := config.NewWithTestDefaults()
v.Set("contentDir", "mycontent")
v.Set("i18nDir", "myi18n")
v.Set("staticDir", "mystatic")
@@ -219,22 +219,19 @@ func TestNewBaseFsEmpty(t *testing.T) {
func TestRealDirs(t *testing.T) {
c := qt.New(t)
v := createConfig()
+ root, themesDir := t.TempDir(), t.TempDir()
+ v.Set("workingDir", root)
+ v.Set("themesDir", themesDir)
+ v.Set("theme", "mytheme")
+
fs := hugofs.NewDefault(v)
sfs := fs.Source
- root, err := afero.TempDir(sfs, "", "realdir")
- c.Assert(err, qt.IsNil)
- themesDir, err := afero.TempDir(sfs, "", "themesDir")
- c.Assert(err, qt.IsNil)
defer func() {
os.RemoveAll(root)
os.RemoveAll(themesDir)
}()
- v.Set("workingDir", root)
- v.Set("themesDir", themesDir)
- v.Set("theme", "mytheme")
-
c.Assert(sfs.MkdirAll(filepath.Join(root, "myassets", "scss", "sf1"), 0755), qt.IsNil)
c.Assert(sfs.MkdirAll(filepath.Join(root, "myassets", "scss", "sf2"), 0755), qt.IsNil)
c.Assert(sfs.MkdirAll(filepath.Join(themesDir, "mytheme", "assets", "scss", "sf2"), 0755), qt.IsNil)