(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func TestLoadConfigFromEnv(t *testing.T) { |
| 41 | assert.Nil(t, os.Setenv("FS_LISTEN_ADDR", ":17300")) |
| 42 | assert.Nil(t, os.Setenv("FS_TUBE_CONFIG__MY_TUBE__KEY", "value")) |
| 43 | assert.Nil(t, os.Setenv("FS_RUNTIME_CONFIG__CUSTOM_RUNTIME__NAME", "test")) |
| 44 | |
| 45 | viper.AutomaticEnv() |
| 46 | |
| 47 | c, err := LoadConfigFromEnv() |
| 48 | require.Nil(t, err) |
| 49 | assertConfig(t, c) |
| 50 | } |
| 51 | |
| 52 | func assertConfig(t *testing.T, c *Config) { |
| 53 | assert.Equal(t, ":17300", c.ListenAddr) |
nothing calls this directly
no test coverage detected