-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Move setEnv & unsetEnv functions
- Loading branch information
Thomas LE ROUX
committed
Mar 21, 2016
1 parent
08c420b
commit f73ec52
Showing
2 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package engine | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
) | ||
|
||
func setEnv(t *testing.T, key, value string) { | ||
if err := os.Setenv(key, value); err != nil { | ||
t.Fatalf("unexpected error: %s", err) | ||
} | ||
} | ||
|
||
func unsetEnv(t *testing.T, key string) { | ||
if err := os.Unsetenv(key); err != nil { | ||
t.Fatalf("unexpected error: %s", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters