diff options
author | Wolfy-J <[email protected]> | 2018-07-26 17:09:53 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-07-26 17:09:53 +0300 |
commit | 2f73d679b884616c49f4eba3342b350c001d949f (patch) | |
tree | e93f4f9505bcb0d597f8a258b046c735e4ff3245 /service/env/service_test.go | |
parent | 8226b1f064ba1dca8f817bb882e0e570fc057e43 (diff) |
more tests
Diffstat (limited to 'service/env/service_test.go')
-rw-r--r-- | service/env/service_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/service/env/service_test.go b/service/env/service_test.go new file mode 100644 index 00000000..4d823468 --- /dev/null +++ b/service/env/service_test.go @@ -0,0 +1,24 @@ +package env + +import ( + "testing" + "github.com/stretchr/testify/assert" +) + +func Test_NewService(t *testing.T) { + s := NewService("version") + assert.Len(t, s.values, 1) +} + +func Test_Extend(t *testing.T) { + s := NewService("version") + + s.Init(&Config{Values: map[string]string{"key": "value"}}) + assert.Len(t, s.values, 2) + + values, err := s.GetEnv() + assert.NoError(t, err) + assert.Len(t, values, 2) + assert.Equal(t, "version", values["rr"]) + assert.Equal(t, "value", values["key"]) +} |