diff options
author | Wolfy-J <[email protected]> | 2019-12-23 14:43:47 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-12-23 14:43:47 +0300 |
commit | c7b0a4a81827284f7565c56aa476eea34fb6382f (patch) | |
tree | ee30e93169c37fb058fbe55af6b3f954eabd9646 /service/env | |
parent | 7f694966730f6dac09d0d0ea3bf51276b8e4dfe4 (diff) |
- test fixes
Diffstat (limited to 'service/env')
-rw-r--r-- | service/env/config_test.go | 5 | ||||
-rw-r--r-- | service/env/service_test.go | 18 |
2 files changed, 19 insertions, 4 deletions
diff --git a/service/env/config_test.go b/service/env/config_test.go index 50fbdaa5..226712c3 100644 --- a/service/env/config_test.go +++ b/service/env/config_test.go @@ -30,6 +30,9 @@ func Test_Config_Hydrate_Empty(t *testing.T) { func Test_Config_Defaults(t *testing.T) { c := &Config{} - c.InitDefaults() + err := c.InitDefaults() + if err != nil { + t.Errorf("Test_Config_Defaults failed: error %v", err) + } assert.Len(t, c.Values, 0) } diff --git a/service/env/service_test.go b/service/env/service_test.go index c20bb76c..19cc03c7 100644 --- a/service/env/service_test.go +++ b/service/env/service_test.go @@ -11,8 +11,12 @@ func Test_NewService(t *testing.T) { } func Test_Init(t *testing.T) { + var err error s := &Service{} - s.Init(&Config{}) + _, err = s.Init(&Config{}) + if err != nil { + t.Errorf("error during the s.Init: error %v", err) + } assert.Len(t, s.values, 1) values, err := s.GetEnv() @@ -21,9 +25,13 @@ func Test_Init(t *testing.T) { } func Test_Extend(t *testing.T) { + var err error s := NewService(map[string]string{"RR": "version"}) - s.Init(&Config{Values: map[string]string{"key": "value"}}) + _, err = s.Init(&Config{Values: map[string]string{"key": "value"}}) + if err != nil { + t.Errorf("error during the s.Init: error %v", err) + } assert.Len(t, s.values, 2) values, err := s.GetEnv() @@ -34,9 +42,13 @@ func Test_Extend(t *testing.T) { } func Test_Set(t *testing.T) { + var err error s := NewService(map[string]string{"RR": "version"}) - s.Init(&Config{Values: map[string]string{"key": "value"}}) + _, err = s.Init(&Config{Values: map[string]string{"key": "value"}}) + if err != nil { + t.Errorf("error during the s.Init: error %v", err) + } assert.Len(t, s.values, 2) s.SetEnv("key", "value-new") |