diff options
Diffstat (limited to 'config_test.go')
| -rw-r--r-- | config_test.go | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/config_test.go b/config_test.go index a303719..0ab881a 100644 --- a/config_test.go +++ b/config_test.go @@ -1,36 +1,17 @@ package main import ( - "strings" + "bytes" + _ "embed" "testing" "github.com/stretchr/testify/assert" ) -const cfg string = ` -message: - from: foo@example.com - to: bar@example.com - subject: New SMS From {{.From}} For {{.To}} - template: | - From: {{.From}} - To: {{.To}} - Date: {{.DateReceived.UTC}} - - {{.Message}} - -smtp: - hostname: example.com:465 - username: bar - password: some password - -twilio: - address: /run/fwdsms/socket - authToken: some token - endpoint: / -` +//go:embed config_example.yaml +var cfg []byte func TestConfig(t *testing.T) { - _, err := loadConfig(strings.NewReader(cfg)) + _, err := loadConfig(bytes.NewReader(cfg)) assert.NoError(t, err) } |
