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/rss_test.go | |
parent | 0ada40591216572b0e4c6a8ab986b0aa4fb13c13 (diff) |
all: Refactor to nonglobal file systems
Updates #2701
Fixes #2951
Diffstat (limited to 'hugolib/rss_test.go')
-rw-r--r-- | hugolib/rss_test.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/hugolib/rss_test.go b/hugolib/rss_test.go index 72a180fe0..74a59be6d 100644 --- a/hugolib/rss_test.go +++ b/hugolib/rss_test.go @@ -17,6 +17,8 @@ import ( "path/filepath" "testing" + "github.com/spf13/hugo/deps" + "github.com/spf13/hugo/hugofs" "github.com/spf13/viper" ) @@ -28,19 +30,19 @@ func TestRSSOutput(t *testing.T) { viper.Set("rssURI", rssURI) viper.Set("title", "RSSTest") - for _, s := range weightedSources { - writeSource(t, filepath.Join("content", "sect", s.Name), string(s.Content)) - } + fs := hugofs.NewMem() - if err := buildAndRenderSite(NewSiteDefaultLang()); err != nil { - t.Fatalf("Failed to build site: %s", err) + for _, src := range weightedSources { + writeSource(t, fs, filepath.Join("content", "sect", src.Name), string(src.Content)) } + buildSingleSite(t, deps.DepsCfg{Fs: fs}, BuildCfg{}) + // Home RSS - assertFileContent(t, filepath.Join("public", rssURI), true, "<?xml", "rss version", "RSSTest") + assertFileContent(t, fs, filepath.Join("public", rssURI), true, "<?xml", "rss version", "RSSTest") // Section RSS - assertFileContent(t, filepath.Join("public", "sect", rssURI), true, "<?xml", "rss version", "Sects on RSSTest") + assertFileContent(t, fs, filepath.Join("public", "sect", rssURI), true, "<?xml", "rss version", "Sects on RSSTest") // Taxonomy RSS - assertFileContent(t, filepath.Join("public", "categories", "hugo", rssURI), true, "<?xml", "rss version", "Hugo on RSSTest") + assertFileContent(t, fs, filepath.Join("public", "categories", "hugo", rssURI), true, "<?xml", "rss version", "Hugo on RSSTest") } |