diff options
-rw-r--r-- | browserenv_unix_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/browserenv_unix_test.go b/browserenv_unix_test.go index 971454e..069c322 100644 --- a/browserenv_unix_test.go +++ b/browserenv_unix_test.go @@ -9,6 +9,15 @@ import ( "testing" ) +func unsetEnvBrowser(t *testing.T) { + t.Helper() + + err := os.Unsetenv("BROWSER") + if err != nil { + t.Fatal(err) + } +} + func TestBrowserCommand(t *testing.T) { tests := []struct { name string @@ -76,6 +85,8 @@ func TestOpenURLStdout(t *testing.T) { if got != url { t.Errorf("got stdout value %q want %q", got, url) } + + unsetEnvBrowser(t) } func TestOpenURLStderr(t *testing.T) { @@ -95,6 +106,8 @@ func TestOpenURLStderr(t *testing.T) { if got != url { t.Errorf("got stdout value %q want %q", got, url) } + + unsetEnvBrowser(t) } func TestOpenURLMultipleBrowserCommands(t *testing.T) { @@ -115,4 +128,6 @@ func TestOpenURLMultipleBrowserCommands(t *testing.T) { if got != url { t.Errorf("got stdout value %q want %q", got, url) } + + unsetEnvBrowser(t) } |