mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-09 12:32:37 +00:00
Move Viper reset to correct level in menu tests
This commit is contained in:
parent
beda46d289
commit
bed8197de5
1 changed files with 6 additions and 4 deletions
|
@ -169,8 +169,6 @@ type testMenuState struct {
|
||||||
|
|
||||||
// Issue 817 - identifier should trump everything
|
// Issue 817 - identifier should trump everything
|
||||||
func TestPageMenuWithIdentifier(t *testing.T) {
|
func TestPageMenuWithIdentifier(t *testing.T) {
|
||||||
viper.Reset()
|
|
||||||
defer viper.Reset()
|
|
||||||
|
|
||||||
toml := []source.ByteSource{
|
toml := []source.ByteSource{
|
||||||
{"sect/doc1.md", tstCreateMenuPageWithIdentifierTOML("t1", "m1", "i1")},
|
{"sect/doc1.md", tstCreateMenuPageWithIdentifierTOML("t1", "m1", "i1")},
|
||||||
|
@ -191,6 +189,9 @@ func TestPageMenuWithIdentifier(t *testing.T) {
|
||||||
|
|
||||||
func doTestPageMenuWithIdentifier(t *testing.T, menuPageSources []source.ByteSource) {
|
func doTestPageMenuWithIdentifier(t *testing.T, menuPageSources []source.ByteSource) {
|
||||||
|
|
||||||
|
viper.Reset()
|
||||||
|
defer viper.Reset()
|
||||||
|
|
||||||
s := setupMenuTests(t, menuPageSources)
|
s := setupMenuTests(t, menuPageSources)
|
||||||
|
|
||||||
assert.Equal(t, 3, len(s.Pages), "Not enough pages")
|
assert.Equal(t, 3, len(s.Pages), "Not enough pages")
|
||||||
|
@ -308,8 +309,6 @@ func TestMenuWithHashInURL(t *testing.T) {
|
||||||
|
|
||||||
// issue #719
|
// issue #719
|
||||||
func TestMenuWithUnicodeURLs(t *testing.T) {
|
func TestMenuWithUnicodeURLs(t *testing.T) {
|
||||||
viper.Reset()
|
|
||||||
defer viper.Reset()
|
|
||||||
|
|
||||||
for _, uglyURLs := range []bool{true, false} {
|
for _, uglyURLs := range []bool{true, false} {
|
||||||
for _, canonifyURLs := range []bool{true, false} {
|
for _, canonifyURLs := range []bool{true, false} {
|
||||||
|
@ -319,6 +318,9 @@ func TestMenuWithUnicodeURLs(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func doTestMenuWithUnicodeURLs(t *testing.T, canonifyURLs, uglyURLs bool) {
|
func doTestMenuWithUnicodeURLs(t *testing.T, canonifyURLs, uglyURLs bool) {
|
||||||
|
viper.Reset()
|
||||||
|
defer viper.Reset()
|
||||||
|
|
||||||
viper.Set("CanonifyURLs", canonifyURLs)
|
viper.Set("CanonifyURLs", canonifyURLs)
|
||||||
viper.Set("UglyURLs", uglyURLs)
|
viper.Set("UglyURLs", uglyURLs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue