diff options
Diffstat (limited to 'service/limit/config_test.go')
-rw-r--r-- | service/limit/config_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/service/limit/config_test.go b/service/limit/config_test.go new file mode 100644 index 00000000..aa793623 --- /dev/null +++ b/service/limit/config_test.go @@ -0,0 +1,20 @@ +package limit + +import ( + "encoding/json" + "github.com/spiral/roadrunner/service" + "github.com/stretchr/testify/assert" + "testing" +) + +type mockCfg struct{ cfg string } + +func (cfg *mockCfg) Get(name string) service.Config { return nil } +func (cfg *mockCfg) Unmarshal(out interface{}) error { return json.Unmarshal([]byte(cfg.cfg), out) } + +func Test_Config_Hydrate_Error1(t *testing.T) { + cfg := &mockCfg{`{"enable": true}`} + c := &Config{} + + assert.Error(t, c.Hydrate(cfg)) +} |