diff options
Diffstat (limited to 'service/env/service_test.go')
-rw-r--r-- | service/env/service_test.go | 18 |
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 |