diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2015-06-21 16:01:02 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2015-06-21 16:01:02 +0300 |
commit | f25ce7fefa797f01cc190c278832b23eb7e923e7 (patch) | |
tree | 168b7a40385ee0852736bcf2ae0bf8784d42d7fc /hugolib/site_test.go | |
parent | d770fa59a5c8096a74d028b5cb698c01a692ed50 (diff) |
Revert "Move matchRender to test helpers file"
This reverts commit 32d91d616e99cd05b59644e292b29be415d5054f.
Diffstat (limited to 'hugolib/site_test.go')
-rw-r--r-- | hugolib/site_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hugolib/site_test.go b/hugolib/site_test.go index e4f9fca04..5b1bb0df2 100644 --- a/hugolib/site_test.go +++ b/hugolib/site_test.go @@ -79,6 +79,18 @@ func NopCloser(w io.Writer) io.WriteCloser { 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 |