summaryrefslogtreecommitdiff
path: root/rpc/service_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/service_test.go')
-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)