blob: f25e56c7f37cac740c081fa36684bc77918817fe (
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 (
"github.com/stretchr/testify/assert"
"testing"
)
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"])
}
|