Skip to content

Commit

Permalink
Merge pull request #1107 from mostynb/test_environment_tempdir
Browse files Browse the repository at this point in the history
Save the temp dir before clearing environment variables
  • Loading branch information
rliebz committed Apr 14, 2020
2 parents 3e069af + 8d907b5 commit 3b22cad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flag_test.go
Expand Up @@ -14,6 +14,8 @@ import (
"time"
)

var osTempDir = os.TempDir()

var boolFlagTests = []struct {
name string
expected string
Expand Down Expand Up @@ -1662,7 +1664,7 @@ func TestFlagFromFile(t *testing.T) {
os.Clearenv()
os.Setenv("APP_FOO", "123")

temp, err := ioutil.TempFile("", "urfave_cli_test")
temp, err := ioutil.TempFile(osTempDir, "urfave_cli_test")
if err != nil {
t.Error(err)
return
Expand Down

0 comments on commit 3b22cad

Please sign in to comment.