summaryrefslogtreecommitdiff
path: root/plugins/broadcast/root/config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/broadcast/root/config_test.go')
-rw-r--r--plugins/broadcast/root/config_test.go60
1 files changed, 0 insertions, 60 deletions
diff --git a/plugins/broadcast/root/config_test.go b/plugins/broadcast/root/config_test.go
deleted file mode 100644
index 28191c6b..00000000
--- a/plugins/broadcast/root/config_test.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package broadcast
-
-import (
- "encoding/json"
- "testing"
-
- "github.com/spiral/roadrunner/service"
- "github.com/spiral/roadrunner/service/rpc"
- "github.com/stretchr/testify/assert"
-)
-
-type testCfg struct {
- rpc string
- broadcast string
- target string
-}
-
-func (cfg *testCfg) Get(name string) service.Config {
- if name == ID {
- return &testCfg{target: cfg.broadcast}
- }
-
- if name == rpc.ID {
- return &testCfg{target: cfg.rpc}
- }
-
- return nil
-}
-
-func (cfg *testCfg) Unmarshal(out interface{}) error {
- return json.Unmarshal([]byte(cfg.target), out)
-}
-
-func Test_Config_Hydrate_Error(t *testing.T) {
- cfg := &testCfg{target: `{"dead`}
- c := &Config{}
-
- assert.Error(t, c.Hydrate(cfg))
-}
-
-func Test_Config_Hydrate_OK(t *testing.T) {
- cfg := &testCfg{target: `{"path":"/path"}`}
- c := &Config{}
-
- assert.NoError(t, c.Hydrate(cfg))
-}
-
-func Test_Config_Redis_Error(t *testing.T) {
- cfg := &testCfg{target: `{"path":"/path","redis":{}}`}
- c := &Config{}
-
- assert.Error(t, c.Hydrate(cfg))
-}
-
-func Test_Config_Redis_OK(t *testing.T) {
- cfg := &testCfg{target: `{"path":"/path","redis":{"addr":"localhost:6379"}}`}
- c := &Config{}
-
- assert.NoError(t, c.Hydrate(cfg))
-}