Commit b9eea82a authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

template: add tests for RawContents

parent 99a93009
...@@ -2,6 +2,7 @@ package template ...@@ -2,6 +2,7 @@ package template
import ( import (
"reflect" "reflect"
"strings"
"testing" "testing"
"time" "time"
) )
...@@ -284,3 +285,16 @@ func TestParse(t *testing.T) { ...@@ -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)
}
}
{"builders":[{"type":"test"}]}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment