mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Stop Viper from leaking across many of the tests (now tests pass regardless of order tested)
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/spf13/cast"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
var EMPTY_PAGE = ""
|
||||
@@ -664,15 +665,19 @@ func TestSliceToLower(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTargetPath(t *testing.T) {
|
||||
viper.Reset()
|
||||
defer viper.Reset()
|
||||
|
||||
viper.Set("DefaultExtension", "html")
|
||||
site_permalinks_setting := PermalinkOverrides{
|
||||
"post": ":year/:month/:day/:title/",
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
content string
|
||||
path string
|
||||
hasPermalink bool
|
||||
expected string
|
||||
content string
|
||||
path string
|
||||
hasPermalink bool
|
||||
expected string
|
||||
}{
|
||||
{SIMPLE_PAGE, "content/post/x.md", false, "content/post/x.html"},
|
||||
{SIMPLE_PAGE_WITH_URL, "content/post/x.md", false, "simple/url/index.html"},
|
||||
|
Reference in New Issue
Block a user