diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2018-02-18 23:25:43 -0500 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2018-04-18 15:23:49 -0400 |
| commit | 0ff06aa75c6a3062852f08c0ae73751530ede6c3 (patch) | |
| tree | 01002e4c015ee950f3b63c6584ebb8462eaf9b87 /gomplate_test.go | |
| parent | cd60ef2d97a45135f3b4127ea0038db5a4ffe847 (diff) | |
Putting main pkg in cmd subdirectory
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'gomplate_test.go')
| -rw-r--r-- | gomplate_test.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gomplate_test.go b/gomplate_test.go index c091f1ea..233faa3b 100644 --- a/gomplate_test.go +++ b/gomplate_test.go @@ -1,4 +1,4 @@ -package main +package gomplate import ( "bytes" @@ -15,14 +15,14 @@ import ( "github.com/stretchr/testify/assert" ) -func testTemplate(g *Gomplate, tmpl string) string { +func testTemplate(g *gomplate, tmpl string) string { var out bytes.Buffer - g.RunTemplate(&tplate{name: "testtemplate", contents: tmpl, target: &out}) + g.runTemplate(&tplate{name: "testtemplate", contents: tmpl, target: &out}) return out.String() } func TestGetenvTemplates(t *testing.T) { - g := &Gomplate{ + g := &gomplate{ funcMap: template.FuncMap{ "getenv": env.Getenv, "bool": conv.Bool, @@ -34,7 +34,7 @@ func TestGetenvTemplates(t *testing.T) { } func TestBoolTemplates(t *testing.T) { - g := &Gomplate{ + g := &gomplate{ funcMap: template.FuncMap{ "bool": conv.Bool, }, @@ -46,9 +46,9 @@ func TestBoolTemplates(t *testing.T) { } func TestEc2MetaTemplates(t *testing.T) { - createGomplate := func(status int, body string) (*Gomplate, *httptest.Server) { + createGomplate := func(status int, body string) (*gomplate, *httptest.Server) { server, ec2meta := aws.MockServer(status, body) - return &Gomplate{funcMap: template.FuncMap{"ec2meta": ec2meta.Meta}}, server + return &gomplate{funcMap: template.FuncMap{"ec2meta": ec2meta.Meta}}, server } g, s := createGomplate(404, "") @@ -66,7 +66,7 @@ func TestEc2MetaTemplates(t *testing.T) { func TestEc2MetaTemplates_WithJSON(t *testing.T) { server, ec2meta := aws.MockServer(200, `{"foo":"bar"}`) defer server.Close() - g := &Gomplate{ + g := &gomplate{ funcMap: template.FuncMap{ "ec2meta": ec2meta.Meta, "ec2dynamic": ec2meta.Dynamic, @@ -79,7 +79,7 @@ func TestEc2MetaTemplates_WithJSON(t *testing.T) { } func TestJSONArrayTemplates(t *testing.T) { - g := &Gomplate{ + g := &gomplate{ funcMap: template.FuncMap{ "jsonArray": data.JSONArray, }, @@ -90,7 +90,7 @@ func TestJSONArrayTemplates(t *testing.T) { } func TestYAMLTemplates(t *testing.T) { - g := &Gomplate{ + g := &gomplate{ funcMap: template.FuncMap{ "yaml": data.YAML, "yamlArray": data.YAMLArray, @@ -103,7 +103,7 @@ func TestYAMLTemplates(t *testing.T) { } func TestSliceTemplates(t *testing.T) { - g := &Gomplate{ + g := &gomplate{ funcMap: template.FuncMap{ "slice": conv.Slice, }, @@ -114,7 +114,7 @@ func TestSliceTemplates(t *testing.T) { } func TestHasTemplate(t *testing.T) { - g := &Gomplate{ + g := &gomplate{ funcMap: template.FuncMap{ "yaml": data.YAML, "has": conv.Has, @@ -138,7 +138,7 @@ func TestHasTemplate(t *testing.T) { } func TestCustomDelim(t *testing.T) { - g := &Gomplate{ + g := &gomplate{ leftDelim: "[", rightDelim: "]", funcMap: template.FuncMap{}, |
