parseEnvFile with environment variable import definitions
(t *testing.T)
| 25 | |
| 26 | // parseEnvFile with environment variable import definitions |
| 27 | func TestParseEnvVariableDefinitionsFile(t *testing.T) { |
| 28 | content := `# comment= |
| 29 | UNDEFINED_VAR |
| 30 | DEFINED_VAR |
| 31 | ` |
| 32 | tmpFile := tmpFileWithContent(t, content) |
| 33 | |
| 34 | t.Setenv("DEFINED_VAR", "defined-value") |
| 35 | variables, err := parseEnvFile(tmpFile) |
| 36 | assert.NilError(t, err) |
| 37 | |
| 38 | expectedLines := []string{"DEFINED_VAR=defined-value"} |
| 39 | assert.Check(t, is.DeepEqual(variables, expectedLines)) |
| 40 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…