summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-23 15:16:08 +0300
committerWolfy-J <[email protected]>2018-09-23 15:16:08 +0300
commit811d6815399348540061795bec2460d54e35cd47 (patch)
treecf05305a6d7432d11eec6806db47967d6c19f526 /service
parent1f079d9b681e65a412fb8b79f013862ff8f1c7db (diff)
more coverage
Diffstat (limited to 'service')
-rw-r--r--service/rpc/service_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/service/rpc/service_test.go b/service/rpc/service_test.go
index 59e0e05d..467cbe3f 100644
--- a/service/rpc/service_test.go
+++ b/service/rpc/service_test.go
@@ -1,6 +1,7 @@
package rpc
import (
+ "github.com/spiral/roadrunner/service/env"
"github.com/stretchr/testify/assert"
"testing"
"time"
@@ -80,3 +81,15 @@ func Test_Serve_Client(t *testing.T) {
assert.NoError(t, client.Call("test.Echo", "hello world", &resp))
assert.Equal(t, "hello world", resp)
}
+
+func TestSetEnv(t *testing.T) {
+ s := &Service{}
+ e := env.NewService(map[string]string{})
+ ok, err := s.Init(&Config{Enable: true, Listen: "tcp://localhost:9018"}, e)
+
+ assert.NoError(t, err)
+ assert.True(t, ok)
+
+ v, _ := e.GetEnv()
+ assert.Equal(t, "tcp://localhost:9018", v["rr_rpc"])
+}