mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-15 21:24:09 +00:00
Revert "Move matchRender to test helpers file"
This reverts commit 32d91d616e
.
This commit is contained in:
parent
d770fa59a5
commit
f25ce7fefa
2 changed files with 12 additions and 13 deletions
|
@ -1,7 +1,6 @@
|
||||||
package hugolib
|
package hugolib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
|
@ -79,15 +78,3 @@ func pageMust(p *Page, err error) *Page {
|
||||||
}
|
}
|
||||||
return p
|
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -79,6 +79,18 @@ func NopCloser(w io.Writer) io.WriteCloser {
|
||||||
return nopCloser{w}
|
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) {
|
func TestRenderThing(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
content string
|
content string
|
||||||
|
|
Loading…
Reference in a new issue