diff options
author | Bjørn Erik Pedersen <[email protected]> | 2016-08-08 13:55:18 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2016-09-06 18:32:18 +0300 |
commit | 8da040342eb0a3098e54dc6ed2cb10bac6173230 (patch) | |
tree | 6ebd4750103cb1ac8a2b1aa6ec4bdb8e85d46ea8 /hugolib/sitemap_test.go | |
parent | d953e39e63deac608e7f1442a6c0d5b2fe56180e (diff) | |
download | hugo-8da040342eb0a3098e54dc6ed2cb10bac6173230.tar.gz hugo-8da040342eb0a3098e54dc6ed2cb10bac6173230.zip |
Render main content language in root by default
Fixes #2312
Diffstat (limited to 'hugolib/sitemap_test.go')
-rw-r--r-- | hugolib/sitemap_test.go | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/hugolib/sitemap_test.go b/hugolib/sitemap_test.go index 6c57084db..d46c8b05c 100644 --- a/hugolib/sitemap_test.go +++ b/hugolib/sitemap_test.go @@ -14,13 +14,12 @@ package hugolib import ( - "bytes" "testing" "reflect" + "strings" "github.com/spf13/hugo/helpers" - "github.com/spf13/hugo/hugofs" "github.com/spf13/hugo/source" "github.com/spf13/viper" ) @@ -50,15 +49,10 @@ func TestSitemapOutput(t *testing.T) { t.Fatalf("Failed to build site: %s", err) } - sitemapFile, err := hugofs.Destination().Open("public/sitemap.xml") + sitemapContent := readDestination(t, "public/sitemap.xml") - if err != nil { - t.Fatalf("Unable to locate: sitemap.xml") - } - - sitemap := helpers.ReaderToBytes(sitemapFile) - if !bytes.HasPrefix(sitemap, []byte("<?xml")) { - t.Errorf("Sitemap file should start with <?xml. %s", sitemap) + if !strings.HasPrefix(sitemapContent, "<?xml") { + t.Errorf("Sitemap file should start with <?xml. %s", sitemapContent) } } |