diff options
author | Wolfy-J <[email protected]> | 2018-06-07 21:11:22 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-07 21:11:22 +0300 |
commit | 2f4e1d950339076574edc50044d6f1ebc3a83a01 (patch) | |
tree | 8c20e8eb8aed59ab8b0032240aa0d956b99fb457 | |
parent | 7a44242ae0b2346239fbb6abac1a146ee0e31847 (diff) |
more tests
-rw-r--r-- | rpc/service_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rpc/service_test.go b/rpc/service_test.go index 8ccad644..109a5df8 100644 --- a/rpc/service_test.go +++ b/rpc/service_test.go @@ -16,6 +16,13 @@ type testCfg struct{ cfg string } func (cfg *testCfg) Get(name string) service.Config { return nil } func (cfg *testCfg) Unmarshal(out interface{}) error { return json.Unmarshal([]byte(cfg.cfg), out) } +func Test_ConfigError(t *testing.T) { + s, err := (&Service{}).WithConfig(&testCfg{`{"enable":false`}, nil) + + assert.Error(t, err) + assert.Nil(t, s) +} + func Test_Disabled(t *testing.T) { s, err := (&Service{}).WithConfig(&testCfg{`{"enable":false}`}, nil) |