From 46e8d9a6eb3365ef1211f203c0a7f234eeb53e6e Mon Sep 17 00:00:00 2001 From: rsteube Date: Wed, 19 Jul 2023 00:30:41 +0200 Subject: [PATCH] sandbox: unset LS_COLORS in test --- example/cmd/modifier_test.go | 2 ++ pkg/sandbox/sandbox.go | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/example/cmd/modifier_test.go b/example/cmd/modifier_test.go index dbbd8785b..c3dfbd560 100644 --- a/example/cmd/modifier_test.go +++ b/example/cmd/modifier_test.go @@ -1,6 +1,7 @@ package cmd import ( + "os" "testing" "time" @@ -128,6 +129,7 @@ func TestMultiParts(t *testing.T) { } func TestPrefix(t *testing.T) { + os.Unsetenv("LS_COLORS") sandbox.Package(t, "github.com/rsteube/carapace/example")(func(s *sandbox.Sandbox) { s.Files("subdir/file1.txt", "") diff --git a/pkg/sandbox/sandbox.go b/pkg/sandbox/sandbox.go index 21aa6ba23..b78c732b4 100644 --- a/pkg/sandbox/sandbox.go +++ b/pkg/sandbox/sandbox.go @@ -17,10 +17,6 @@ import ( "github.com/spf13/cobra" ) -func init() { - os.Unsetenv("LS_COLORS") -} - type Sandbox struct { t *testing.T cmdF func() *cobra.Command