diff options
author | Bjørn Erik Pedersen <[email protected]> | 2016-07-28 09:30:58 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2016-09-06 18:32:16 +0300 |
commit | 708bc78770a0b0361908f6404f57264c53252a95 (patch) | |
tree | 9b7e3a05b1e83a768bfa0dd96b61b07dd7917cfd /hugolib/rss_test.go | |
parent | f023dfd7636f73b11c94e86a05c6273941d52c58 (diff) | |
download | hugo-708bc78770a0b0361908f6404f57264c53252a95.tar.gz hugo-708bc78770a0b0361908f6404f57264c53252a95.zip |
Optimize the multilanguage build process
Work In Progress!
This commit makes a rework of the build and rebuild process to better suit a multi-site setup.
This also includes a complete overhaul of the site tests. Previous these were a messy mix that
were testing just small parts of the build chain, some of it testing code-paths not even used in
"real life". Now all tests that depends on a built site follows the same and real production code path.
See #2309
Closes #2211
Closes #477
Closes #1744
Diffstat (limited to 'hugolib/rss_test.go')
-rw-r--r-- | hugolib/rss_test.go | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/hugolib/rss_test.go b/hugolib/rss_test.go index 72ec25fca..f9f26cb7b 100644 --- a/hugolib/rss_test.go +++ b/hugolib/rss_test.go @@ -15,6 +15,7 @@ package hugolib import ( "bytes" + "path/filepath" "testing" "github.com/spf13/hugo/helpers" @@ -45,28 +46,23 @@ const rssTemplate = `<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" </rss>` func TestRSSOutput(t *testing.T) { - viper.Reset() - defer viper.Reset() + testCommonResetState() - rssURI := "customrss.xml" + rssURI := "public/customrss.xml" viper.Set("baseurl", "http://auth/bub/") viper.Set("RSSUri", rssURI) hugofs.InitMemFs() s := &Site{ - Source: &source.InMemorySource{ByteSource: weightedSources}, - Lang: newDefaultLanguage(), + Source: &source.InMemorySource{ByteSource: weightedSources}, + Language: newDefaultLanguage(), } - s.initializeSiteInfo() - s.prepTemplates("rss.xml", rssTemplate) - createPagesAndMeta(t, s) - - if err := s.renderHomePage(); err != nil { - t.Fatalf("Unable to RenderHomePage: %s", err) + if err := buildAndRenderSite(s, "rss.xml", rssTemplate); err != nil { + t.Fatalf("Failed to build site: %s", err) } - file, err := hugofs.Destination().Open(rssURI) + file, err := hugofs.Destination().Open(filepath.Join("public", rssURI)) if err != nil { t.Fatalf("Unable to locate: %s", rssURI) |