diff options
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"]) +} |