summaryrefslogtreecommitdiff
path: root/service/limit/config_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-05-04 23:07:30 +0300
committerWolfy-J <[email protected]>2019-05-04 23:07:30 +0300
commit3800c27ff9ec2641248d6dc2ce2f7ab56c237664 (patch)
treec8026df76f0fea5519f958d310210e1da46f369d /service/limit/config_test.go
parent2afa417f4f46b31b79043e3e56513d51e4ad2fde (diff)
golint
Diffstat (limited to 'service/limit/config_test.go')
-rw-r--r--service/limit/config_test.go20
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))
+}