summaryrefslogtreecommitdiff
path: root/service/env/service_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-07 23:26:26 +0300
committerWolfy-J <[email protected]>2018-09-07 23:26:26 +0300
commitcac8bf48bab69ff3468cf7d30ac1c18904885a47 (patch)
tree5ffec205a9b51a933339d535de198a267be0275a /service/env/service_test.go
parentea97c188a4a74c00b585cb50fa1ed4db7d190e09 (diff)
added ability to alter env values
Diffstat (limited to 'service/env/service_test.go')
-rw-r--r--service/env/service_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/service/env/service_test.go b/service/env/service_test.go
index 69a2a375..10159857 100644
--- a/service/env/service_test.go
+++ b/service/env/service_test.go
@@ -22,3 +22,21 @@ func Test_Extend(t *testing.T) {
assert.Equal(t, "version", values["rr"])
assert.Equal(t, "value", values["key"])
}
+
+
+func Test_Set(t *testing.T) {
+ s := NewService(map[string]string{"rr": "version"})
+
+ s.Init(&Config{Values: map[string]string{"key": "value"}})
+ assert.Len(t, s.values, 2)
+
+ s.SetEnv("key","value-new")
+ s.SetEnv("other","new")
+
+ values, err := s.GetEnv()
+ assert.NoError(t, err)
+ assert.Len(t, values, 3)
+ assert.Equal(t, "version", values["rr"])
+ assert.Equal(t, "value-new", values["key"])
+ assert.Equal(t, "new", values["other"])
+} \ No newline at end of file