summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-07 21:11:22 +0300
committerWolfy-J <[email protected]>2018-06-07 21:11:22 +0300
commit2f4e1d950339076574edc50044d6f1ebc3a83a01 (patch)
tree8c20e8eb8aed59ab8b0032240aa0d956b99fb457
parent7a44242ae0b2346239fbb6abac1a146ee0e31847 (diff)
more tests
-rw-r--r--rpc/service_test.go7
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)