mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Updating tests to use new Targets & Writers and switch to using Afero.MemMapFs for more accurate tests.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user