diff options
Diffstat (limited to 'service/env/service_test.go')
-rw-r--r-- | service/env/service_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/service/env/service_test.go b/service/env/service_test.go index 61fecd28..c20bb76c 100644 --- a/service/env/service_test.go +++ b/service/env/service_test.go @@ -49,3 +49,20 @@ func Test_Set(t *testing.T) { assert.Equal(t, "value-new", values["key"]) assert.Equal(t, "new", values["other"]) } + +func Test_Copy(t *testing.T) { + s1 := NewService(map[string]string{"RR": "version"}) + s2 := NewService(map[string]string{}) + + s1.SetEnv("key", "value-new") + s1.SetEnv("other", "new") + + assert.NoError(t, s1.Copy(s2)) + + values, err := s2.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"]) +} |