@ -47,12 +47,12 @@ func TestValidateQuotes(t *testing.T) {
for _ , test := range failTest {
for _ , test := range failTest {
err := validateQuotes ( "testTemplate.yaml" , test )
err := validateQuotes ( "testTemplate.yaml" , test )
if err == nil || ! strings . Contains ( err . Error ( ) , " add \"| quote\" to your substitution functions ") {
if err == nil || ! strings . Contains ( err . Error ( ) , " use the sprig \"quote\" function ") {
t . Errorf ( "validateQuotes('%s') to return \" add | quote error\", got no error ", test )
t . Errorf ( "validateQuotes('%s') to return \" use the sprig \"quote\" function:\", got no error. ", test )
}
}
}
}
var successTest = [ ] string { "foo: {{.Release.Service | quote }}" , "foo: {{.Release.Service | quote }}" , "- {{.Release.Service | quote }}" , "foo: {{default 'Never' .restart_policy | quote }}" , "foo: \"{{ .Release.Service }}\"" , "foo: \"{{ .Release.Service }} {{ .Foo.Bar }}\"" , "foo: \"{{ default 'Never' .Release.Service }} {{ .Foo.Bar }}\"" }
var successTest = [ ] string { "foo: {{.Release.Service | quote }}" , "foo: {{.Release.Service | quote }}" , "- {{.Release.Service | quote }}" , "foo: {{default 'Never' .restart_policy | quote }}" , "foo: \"{{ .Release.Service }}\"" , "foo: \"{{ .Release.Service }} {{ .Foo.Bar }}\"" , "foo: \"{{ default 'Never' .Release.Service }} {{ .Foo.Bar }}\"" , "foo: {{.Release.Service | squote }}" }
for _ , test := range successTest {
for _ , test := range successTest {
err := validateQuotes ( "testTemplate.yaml" , test )
err := validateQuotes ( "testTemplate.yaml" , test )
@ -66,8 +66,8 @@ func TestValidateQuotes(t *testing.T) {
for _ , test := range failTest {
for _ , test := range failTest {
err := validateQuotes ( "testTemplate.yaml" , test )
err := validateQuotes ( "testTemplate.yaml" , test )
if err == nil || ! strings . Contains ( err . Error ( ) , " wrap your substitution functions in double quotes") {
if err == nil || ! strings . Contains ( err . Error ( ) , " Wrap your substitution functions in quotes") {
t . Errorf ( "validateQuotes('%s') to return \" wrap your substitution functions in double quotes\", got no error %s", test , err . Error ( ) )
t . Errorf ( "validateQuotes('%s') to return \" Wrap your substitution functions in quotes\", got no error", test )
}
}
}
}