diff options
author | Valery Piashchynski <[email protected]> | 2021-05-05 16:39:22 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-05-05 16:39:22 +0300 |
commit | 4fa94bb7f73a705293c2afd40fc1151a3aaa04e2 (patch) | |
tree | 6ffd858cade87600bbd4432f70db22f50c598db0 /plugins/broadcast/websockets/config_test.go | |
parent | 9ee78f937d5be67058882dd3590f89da35bca239 (diff) |
- Initial broadcast commit
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/broadcast/websockets/config_test.go')
-rw-r--r-- | plugins/broadcast/websockets/config_test.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/plugins/broadcast/websockets/config_test.go b/plugins/broadcast/websockets/config_test.go deleted file mode 100644 index e646fdc4..00000000 --- a/plugins/broadcast/websockets/config_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package websockets - -import ( - "encoding/json" - "testing" - - "github.com/spiral/roadrunner/service" - "github.com/stretchr/testify/assert" -) - -type mockCfg struct{ cfg string } - -func (cfg *mockCfg) Get(name string) service.Config { - if name == "same" || name == "jobs" { - return cfg - } - - return nil -} -func (cfg *mockCfg) Unmarshal(out interface{}) error { return json.Unmarshal([]byte(cfg.cfg), out) } - -func Test_Config_Hydrate_Error(t *testing.T) { - cfg := &mockCfg{cfg: `{"dead`} - c := &Config{} - - assert.Error(t, c.Hydrate(cfg)) -} - -func Test_Config_Hydrate_OK(t *testing.T) { - cfg := &mockCfg{cfg: `{"path":"/path"}`} - c := &Config{} - - assert.NoError(t, c.Hydrate(cfg)) -} |