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:
@@ -4,12 +4,13 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"html/template"
|
||||
|
||||
"github.com/spf13/afero"
|
||||
"github.com/spf13/hugo/hugofs"
|
||||
"github.com/spf13/hugo/source"
|
||||
"github.com/spf13/hugo/target"
|
||||
"github.com/spf13/viper"
|
||||
"html/template"
|
||||
)
|
||||
|
||||
const SLUG_DOC_1 = "---\ntitle: slug doc 1\nslug: slug-doc-1\naliases:\n - sd1/foo/\n - sd2\n - sd3/\n - sd4.html\n---\nslug doc 1 content\n"
|
||||
@@ -54,6 +55,8 @@ var urlFakeSource = []source.ByteSource{
|
||||
|
||||
// Issue #1105
|
||||
func TestShouldNotAddTrailingSlashToBaseURL(t *testing.T) {
|
||||
viper.Reset()
|
||||
defer viper.Reset()
|
||||
|
||||
for i, this := range []struct {
|
||||
in string
|
||||
@@ -76,6 +79,9 @@ func TestShouldNotAddTrailingSlashToBaseURL(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPageCount(t *testing.T) {
|
||||
viper.Reset()
|
||||
defer viper.Reset()
|
||||
|
||||
hugofs.DestinationFS = new(afero.MemMapFs)
|
||||
|
||||
viper.Set("uglyurls", false)
|
||||
|
Reference in New Issue
Block a user