You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
538 B
26 lines
538 B
package yaml_test
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
provider "gitoa.ru/go-4devs/config/provider/yaml"
|
|
"gitoa.ru/go-4devs/config/test"
|
|
)
|
|
|
|
func TestProvider(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
prov, err := provider.New(test.ReadFile("config.yaml"))
|
|
require.Nil(t, err)
|
|
|
|
read := []test.Read{
|
|
test.NewRead("duration_var", 21*time.Minute),
|
|
test.NewRead("app/name/bool_var", true),
|
|
test.NewRead("time_var", test.Time("2020-01-02T15:04:05Z")),
|
|
test.NewReadConfig("cfg"),
|
|
}
|
|
|
|
test.Run(t, prov, read)
|
|
}
|
|
|