aboutsummaryrefslogtreecommitdiff
path: root/config_test.go
blob: a303719b72b1a44c2284b92d0a76177f5ddd9273 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main

import (
	"strings"
	"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: /
`

func TestConfig(t *testing.T) {
	_, err := loadConfig(strings.NewReader(cfg))
	assert.NoError(t, err)
}