hugolib: Apply Golint rules to rss_test.go

This commit is contained in:
Bjørn Erik Pedersen 2016-03-24 14:20:00 +01:00
parent b8bf01cdc6
commit 3bbfd99176

View file

@ -24,7 +24,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
) )
const RSS_TEMPLATE = `<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> const rssTemplate = `<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel> <channel>
<title>{{ .Title }} on {{ .Site.Title }} </title> <title>{{ .Title }} on {{ .Site.Title }} </title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>
@ -49,16 +49,16 @@ func TestRSSOutput(t *testing.T) {
viper.Reset() viper.Reset()
defer viper.Reset() defer viper.Reset()
rssUri := "customrss.xml" rssURI := "customrss.xml"
viper.Set("baseurl", "http://auth/bub/") viper.Set("baseurl", "http://auth/bub/")
viper.Set("RSSUri", rssUri) viper.Set("RSSUri", rssURI)
hugofs.DestinationFS = new(afero.MemMapFs) hugofs.DestinationFS = new(afero.MemMapFs)
s := &Site{ s := &Site{
Source: &source.InMemorySource{ByteSource: WEIGHTED_SOURCES}, Source: &source.InMemorySource{ByteSource: WEIGHTED_SOURCES},
} }
s.initializeSiteInfo() s.initializeSiteInfo()
s.prepTemplates("rss.xml", RSS_TEMPLATE) s.prepTemplates("rss.xml", rssTemplate)
if err := s.CreatePages(); err != nil { if err := s.CreatePages(); err != nil {
t.Fatalf("Unable to create pages: %s", err) t.Fatalf("Unable to create pages: %s", err)
@ -72,10 +72,10 @@ func TestRSSOutput(t *testing.T) {
t.Fatalf("Unable to RenderHomePage: %s", err) t.Fatalf("Unable to RenderHomePage: %s", err)
} }
file, err := hugofs.DestinationFS.Open(rssUri) file, err := hugofs.DestinationFS.Open(rssURI)
if err != nil { if err != nil {
t.Fatalf("Unable to locate: %s", rssUri) t.Fatalf("Unable to locate: %s", rssURI)
} }
rss := helpers.ReaderToBytes(file) rss := helpers.ReaderToBytes(file)