diff options
author | Wolfy-J <[email protected]> | 2018-09-23 15:16:08 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-09-23 15:16:08 +0300 |
commit | 811d6815399348540061795bec2460d54e35cd47 (patch) | |
tree | cf05305a6d7432d11eec6806db47967d6c19f526 /service | |
parent | 1f079d9b681e65a412fb8b79f013862ff8f1c7db (diff) |
more coverage
Diffstat (limited to 'service')
-rw-r--r-- | service/rpc/service_test.go | 13 |
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"]) +} |