Stop Viper from leaking across many of the tests (now tests pass regardless of order tested)

This commit is contained in:
spf13
2015-05-20 02:21:21 -04:00
parent 599d1b9786
commit a584ff207b
15 changed files with 223 additions and 101 deletions

View File

@@ -33,10 +33,12 @@ const RSS_TEMPLATE = `<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom
</rss>`
func TestRSSOutput(t *testing.T) {
viper.Reset()
defer viper.Reset()
rssUri := "customrss.xml"
viper.Set("baseurl", "http://auth/bub/")
viper.Set("RSSUri", rssUri)
defer viper.Set("RSSUri", "index.xml")
hugofs.DestinationFS = new(afero.MemMapFs)
s := &Site{
@@ -44,6 +46,7 @@ func TestRSSOutput(t *testing.T) {
}
s.initializeSiteInfo()
s.prepTemplates()
// Add an rss.xml template to invoke the rss build.
s.addTemplate("rss.xml", RSS_TEMPLATE)