blob: 4d8234686e86f66f9409c97de421dffcd27a11da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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"])
}
|