summaryrefslogtreecommitdiff
path: root/service/env/service_test.go
blob: 89bb3bdab5aedf4584fe7d1bf752f2436b9d2f01 (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(map[string]string{"version": "test"})
	assert.Len(t, s.values, 1)
}

func Test_Extend(t *testing.T) {
	s := NewService(map[string]string{"version": "rr"})

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