github.com/skabbes/up@v0.2.1/config/certs_test.go (about) 1 package config 2 3 import ( 4 "testing" 5 6 "github.com/tj/assert" 7 ) 8 9 func TestCert_Validate(t *testing.T) { 10 t.Run("invalid", func(t *testing.T) { 11 c := &Cert{} 12 assert.EqualError(t, c.Validate(), `.domains: must have at least 1 value`) 13 }) 14 } 15 16 func TestCerts_Validate(t *testing.T) { 17 t.Run("invalid", func(t *testing.T) { 18 c := Certs{ 19 Cert{Domains: []string{"apex.sh"}}, 20 Cert{}, 21 } 22 23 assert.EqualError(t, c.Validate(), `cert 1: .domains: must have at least 1 value`) 24 }) 25 }