Skip to content

Commit e816f4b

Browse files
test(dir): fix failing unit test
Signed-off-by: Jason <[email protected]>
1 parent 045ebb6 commit e816f4b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dir/path_test.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
package dir
1515

1616
import (
17+
"os"
1718
"path/filepath"
1819
"testing"
1920
)
@@ -45,9 +46,11 @@ func Test_UserConfigDirPath(t *testing.T) {
4546

4647
func Test_NoHomeVariable(t *testing.T) {
4748
t.Setenv("HOME", "")
48-
userConfigDir := UserConfigDirPath()
49-
if userConfigDir != "notation" {
50-
t.Fatalf(`UserConfigDirPath() = %q, want "notation"`, userConfigDir)
49+
UserConfigDir = ""
50+
userConfigDir = os.UserConfigDir
51+
got := UserConfigDirPath()
52+
if got != "notation" {
53+
t.Fatalf(`UserConfigDirPath() = %q, want "notation"`, UserConfigDir)
5154
}
5255
}
5356

0 commit comments

Comments
 (0)