shithub: hugo

Download patch

ref: f25ce7fefa797f01cc190c278832b23eb7e923e7
parent: d770fa59a5c8096a74d028b5cb698c01a692ed50
author: Bjørn Erik Pedersen <[email protected]>
date: Sun Jun 21 11:01:02 EDT 2015

Revert "Move matchRender to test helpers file"

This reverts commit 32d91d616e99cd05b59644e292b29be415d5054f.

--- a/hugolib/helpers_for_test.go
+++ b/hugolib/helpers_for_test.go
@@ -1,7 +1,6 @@
 package hugolib
 
 import (
-	"bytes"
 	"testing"
 
 	"github.com/spf13/afero"
@@ -78,16 +77,4 @@
 		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,6 +79,18 @@
 	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