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

@ -16,6 +16,11 @@ package hugolib
import (
"encoding/json"
"testing"
"path/filepath"
"github.com/spf13/hugo/deps"
"github.com/spf13/hugo/hugofs"
)
// Issue #1123
@ -23,9 +28,15 @@ import (
// May be smart to run with: -timeout 4000ms
func TestEncodePage(t *testing.T) {
fs := hugofs.NewMem()
// borrowed from menu_test.go
s := createTestSite(menuPageSources)
testSiteSetup(s, t)
for _, src := range menuPageSources {
writeSource(t, fs, filepath.Join("content", src.Name), string(src.Content))
}
s := buildSingleSite(t, deps.DepsCfg{Fs: fs}, BuildCfg{})
_, err := json.Marshal(s)
check(t, err)