1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-04-11 11:42:15 +02:00

test: header/footer invalid templates

refs #2326

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos A Becker 2021-07-03 19:23:29 +00:00
parent 433335a2e1
commit d4a455fc5a
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -104,3 +104,23 @@ func TestDescribeBodyWithHeaderAndFooter(t *testing.T) {
golden.RequireEqual(t, out.Bytes())
}
func TestDescribeBodyWithInvalidHeaderTemplate(t *testing.T) {
ctx := context.New(config.Project{
Release: config.Release{
Header: "## {{ .Nop }\n",
},
})
_, err := describeBody(ctx)
require.EqualError(t, err, `template: tmpl:1: unexpected "}" in operand`)
}
func TestDescribeBodyWithInvalidFooterTemplate(t *testing.T) {
ctx := context.New(config.Project{
Release: config.Release{
Footer: "{{ .Nops }",
},
})
_, err := describeBody(ctx)
require.EqualError(t, err, `template: tmpl:1: unexpected "}" in operand`)
}