summaryrefslogtreecommitdiffstats
path: root/helpers/path_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/path_test.go')
-rw-r--r--helpers/path_test.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/helpers/path_test.go b/helpers/path_test.go
index c2ac19675..2c6cb9f37 100644
--- a/helpers/path_test.go
+++ b/helpers/path_test.go
@@ -25,6 +25,8 @@ import (
"testing"
"time"
+ "github.com/gohugoio/hugo/langs"
+
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
@@ -56,11 +58,10 @@ func TestMakePath(t *testing.T) {
}
for _, test := range tests {
- v := viper.New()
- v.Set("contentDir", "content")
+ v := newTestCfg()
v.Set("removePathAccents", test.removeAccents)
- l := NewDefaultLanguage(v)
+ l := langs.NewDefaultLanguage(v)
p, err := NewPathSpec(hugofs.NewMem(v), l)
require.NoError(t, err)
@@ -74,8 +75,12 @@ func TestMakePath(t *testing.T) {
func TestMakePathSanitized(t *testing.T) {
v := viper.New()
v.Set("contentDir", "content")
+ v.Set("dataDir", "data")
+ v.Set("i18nDir", "i18n")
+ v.Set("layoutDir", "layouts")
+ v.Set("archetypeDir", "archetypes")
- l := NewDefaultLanguage(v)
+ l := langs.NewDefaultLanguage(v)
p, _ := NewPathSpec(hugofs.NewMem(v), l)
tests := []struct {
@@ -99,12 +104,11 @@ func TestMakePathSanitized(t *testing.T) {
}
func TestMakePathSanitizedDisablePathToLower(t *testing.T) {
- v := viper.New()
+ v := newTestCfg()
v.Set("disablePathToLower", true)
- v.Set("contentDir", "content")
- l := NewDefaultLanguage(v)
+ l := langs.NewDefaultLanguage(v)
p, _ := NewPathSpec(hugofs.NewMem(v), l)
tests := []struct {