diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-01-10 10:55:03 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-02-04 11:37:25 +0700 |
commit | c71e1b106e6011d148cac899f83c4685dee33a22 (patch) | |
tree | c5c7090f0c2398c7771e4908ebcc97aa7714ffd2 /hugolib/taxonomy_test.go | |
parent | 0ada40591216572b0e4c6a8ab986b0aa4fb13c13 (diff) |
all: Refactor to nonglobal file systems
Updates #2701
Fixes #2951
Diffstat (limited to 'hugolib/taxonomy_test.go')
-rw-r--r-- | hugolib/taxonomy_test.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go index 65b36d4e5..5cbd58d10 100644 --- a/hugolib/taxonomy_test.go +++ b/hugolib/taxonomy_test.go @@ -18,6 +18,9 @@ import ( "reflect" "testing" + "github.com/spf13/hugo/deps" + "github.com/spf13/hugo/hugofs" + "github.com/spf13/viper" ) @@ -31,16 +34,14 @@ func TestByCountOrderOfTaxonomies(t *testing.T) { viper.Set("taxonomies", taxonomies) - writeSource(t, filepath.Join("content", "page.md"), pageYamlWithTaxonomiesA) + fs := hugofs.NewMem() - site := NewSiteDefaultLang() + writeSource(t, fs, filepath.Join("content", "page.md"), pageYamlWithTaxonomiesA) - if err := buildSiteSkipRender(site); err != nil { - t.Fatalf("Failed to build site: %s", err) - } + s := buildSingleSite(t, deps.DepsCfg{Fs: fs}, BuildCfg{}) st := make([]string, 0) - for _, t := range site.Taxonomies["tags"].ByCount() { + for _, t := range s.Taxonomies["tags"].ByCount() { st = append(st, t.Name) } |