Updating tests to use new Targets & Writers and switch to using Afero.MemMapFs for more accurate tests.

This commit is contained in:
spf13
2014-11-04 00:41:47 -05:00
parent 7b960ac121
commit 4dcf734acd
6 changed files with 81 additions and 75 deletions

View File

@@ -5,8 +5,9 @@ import (
"testing"
"github.com/BurntSushi/toml"
"github.com/spf13/afero"
"github.com/spf13/hugo/hugofs"
"github.com/spf13/hugo/source"
"github.com/spf13/hugo/target"
"github.com/spf13/viper"
)
@@ -283,11 +284,9 @@ func resetMenuTestState(state *testMenuState) {
}
func createTestSite() *Site {
files := make(map[string][]byte)
target := &target.InMemoryTarget{Files: files}
hugofs.DestinationFS = new(afero.MemMapFs)
s := &Site{
Target: target,
Source: &source.InMemorySource{ByteSource: MENU_PAGE_SOURCES},
}
return s