all: Refactor to nonglobal file systems

Updates #2701
Fixes #2951
This commit is contained in:
Bjørn Erik Pedersen
2017-01-10 10:55:03 +01:00
parent 0ada405912
commit c71e1b106e
71 changed files with 2219 additions and 1731 deletions

View File

@@ -18,6 +18,7 @@ import (
"github.com/spf13/hugo/helpers"
"github.com/spf13/hugo/hugofs"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -30,7 +31,10 @@ func TestLoadGlobalConfig(t *testing.T) {
PaginatePath = "side"
`
writeSource(t, "hugo.toml", configContent)
fs := hugofs.NewMem()
viper.SetFs(fs.Source)
writeSource(t, fs, "hugo.toml", configContent)
require.NoError(t, LoadGlobalConfig("", "hugo.toml"))
assert.Equal(t, "side", helpers.Config().GetString("paginatePath"))