File tree 3 files changed +4
-26
lines changed
3 files changed +4
-26
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,7 @@ func TestExactVersion(t *testing.T) {
27
27
28
28
// TODO: mock out command execution?
29
29
30
- originalPath := os .Getenv ("PATH" )
31
- os .Setenv ("PATH" , "" )
32
- t .Cleanup (func () {
33
- os .Setenv ("PATH" , originalPath )
34
- })
30
+ t .Setenv ("PATH" , "" )
35
31
36
32
ev := & ExactVersion {
37
33
Product : product .Terraform ,
Original file line number Diff line number Diff line change @@ -17,14 +17,8 @@ import (
17
17
func TestAnyVersion_notExecutable (t * testing.T ) {
18
18
testutil .EndToEndTest (t )
19
19
20
- originalPath := os .Getenv ("PATH" )
21
- os .Setenv ("PATH" , "" )
22
- t .Cleanup (func () {
23
- os .Setenv ("PATH" , originalPath )
24
- })
25
-
26
20
dirPath , fileName := createTempFile (t , "" )
27
- os .Setenv ("PATH" , dirPath )
21
+ t .Setenv ("PATH" , dirPath )
28
22
29
23
av := & AnyVersion {
30
24
Product : & product.Product {
@@ -41,14 +35,8 @@ func TestAnyVersion_notExecutable(t *testing.T) {
41
35
func TestAnyVersion_executable (t * testing.T ) {
42
36
testutil .EndToEndTest (t )
43
37
44
- originalPath := os .Getenv ("PATH" )
45
- os .Setenv ("PATH" , "" )
46
- t .Cleanup (func () {
47
- os .Setenv ("PATH" , originalPath )
48
- })
49
-
50
38
dirPath , fileName := createTempFile (t , "" )
51
- os .Setenv ("PATH" , dirPath )
39
+ t .Setenv ("PATH" , dirPath )
52
40
53
41
fullPath := filepath .Join (dirPath , fileName )
54
42
err := os .Chmod (fullPath , 0700 )
Original file line number Diff line number Diff line change @@ -14,14 +14,8 @@ import (
14
14
func TestAnyVersion_executable (t * testing.T ) {
15
15
testutil .EndToEndTest (t )
16
16
17
- originalPath := os .Getenv ("path" )
18
- os .Setenv ("path" , "" )
19
- t .Cleanup (func () {
20
- os .Setenv ("path" , originalPath )
21
- })
22
-
23
17
dirPath , fileName := createTempFile (t , "" )
24
- os .Setenv ("path" , dirPath )
18
+ t .Setenv ("path" , dirPath )
25
19
26
20
av := & AnyVersion {
27
21
Product : & product.Product {
You can’t perform that action at this time.
0 commit comments