summaryrefslogtreecommitdiff
path: root/service/env/service_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-07-26 17:09:53 +0300
committerWolfy-J <[email protected]>2018-07-26 17:09:53 +0300
commit2f73d679b884616c49f4eba3342b350c001d949f (patch)
treee93f4f9505bcb0d597f8a258b046c735e4ff3245 /service/env/service_test.go
parent8226b1f064ba1dca8f817bb882e0e570fc057e43 (diff)
more tests
Diffstat (limited to 'service/env/service_test.go')
-rw-r--r--service/env/service_test.go24
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"])
+}