Files
config/provider/json/provider_test.go
andrey1s 913ca9672d
Some checks failed
continuous-integration/drone/push Build is failing
first commit
2021-04-27 14:58:19 +03:00

28 lines
553 B
Go

package json_test
import (
"testing"
"time"
provider "gitoa.ru/go-4devs/config/provider/json"
"gitoa.ru/go-4devs/config/test"
)
func TestProvider(t *testing.T) {
t.Parallel()
js := test.ReadFile("config.json")
prov := provider.New(js)
sl := []string{}
read := []test.Read{
test.NewRead("app.name.title", "config title"),
test.NewRead("app.name.timeout", time.Minute),
test.NewReadUnmarshal("app.name.var", &[]string{"name"}, &sl),
test.NewReadConfig("cfg"),
test.NewRead("app.name.success", true),
}
test.Run(t, prov, read)
}