Merge pull request #1107 from mostynb/test_environment_tempdir
Save the temp dir before clearing environment variables
This commit is contained in:
commit
3b22cad8d7
@ -14,6 +14,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var osTempDir = os.TempDir()
|
||||||
|
|
||||||
var boolFlagTests = []struct {
|
var boolFlagTests = []struct {
|
||||||
name string
|
name string
|
||||||
expected string
|
expected string
|
||||||
@ -1662,7 +1664,7 @@ func TestFlagFromFile(t *testing.T) {
|
|||||||
os.Clearenv()
|
os.Clearenv()
|
||||||
os.Setenv("APP_FOO", "123")
|
os.Setenv("APP_FOO", "123")
|
||||||
|
|
||||||
temp, err := ioutil.TempFile("", "urfave_cli_test")
|
temp, err := ioutil.TempFile(osTempDir, "urfave_cli_test")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user