template: add tests for RawContents
This commit is contained in:
parent
99a93009ed
commit
b9eea82a36
|
@ -2,6 +2,7 @@ package template
|
|||
|
||||
import (
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
@ -284,3 +285,16 @@ func TestParse(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestParse_contents(t *testing.T) {
|
||||
tpl, err := ParseFile(fixtureDir("parse-contents.json"))
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
actual := strings.TrimSpace(string(tpl.RawContents))
|
||||
expected := `{"builders":[{"type":"test"}]}`
|
||||
if actual != expected {
|
||||
t.Fatalf("bad: %s\n\n%s", actual, expected)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
{"builders":[{"type":"test"}]}
|
Loading…
Reference in New Issue