diff options
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)) -} |