ref: 32d91d616e99cd05b59644e292b29be415d5054f
parent: 99e250917ddc351d45adfeb81057ea3607d1b148
author: spf13 <[email protected]>
date: Wed Jun 17 06:38:46 EDT 2015
Move matchRender to test helpers file
--- a/hugolib/helpers_for_test.go
+++ b/hugolib/helpers_for_test.go
@@ -1,6 +1,7 @@
package hugolib
import (
+ "bytes"
"testing"
"github.com/spf13/afero"
@@ -77,4 +78,16 @@
panic(err)
}
return p
+}
+
+func matchRender(t *testing.T, s *Site, p *Page, tmplName string, expected string) {
+ content := new(bytes.Buffer)
+ err := s.renderThing(p, tmplName, NopCloser(content))
+ if err != nil {
+ t.Fatalf("Unable to render template.")
+ }
+
+ if string(content.Bytes()) != expected {
+ t.Fatalf("Content did not match expected: %s. got: %s", expected, content)
+ }
}
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -79,18 +79,6 @@
return nopCloser{w}
}
-func matchRender(t *testing.T, s *Site, p *Page, tmplName string, expected string) {
- content := new(bytes.Buffer)
- err := s.renderThing(p, tmplName, NopCloser(content))
- if err != nil {
- t.Fatalf("Unable to render template.")
- }
-
- if string(content.Bytes()) != expected {
- t.Fatalf("Content did not match expected: %s. got: %s", expected, content)
- }
-}
-
func TestRenderThing(t *testing.T) {
tests := []struct {
content string