Skip to content

Commit

Permalink
test(dir): test unset HOME
Browse files Browse the repository at this point in the history
Signed-off-by: Jason <[email protected]>
  • Loading branch information
JasonTheDeveloper committed Sep 2, 2024
1 parent 25a5d50 commit 045ebb6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dir/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ func Test_UserConfigDirPath(t *testing.T) {
}
}

func Test_NoHomeVariable(t *testing.T) {
t.Setenv("HOME", "")
userConfigDir := UserConfigDirPath()
if userConfigDir != "notation" {
t.Fatalf(`UserConfigDirPath() = %q, want "notation"`, userConfigDir)
}
}

func Test_UserLibexecDirPath(t *testing.T) {
userConfigDir = mockGetUserConfig
got := UserLibexecDirPath()
Expand All @@ -51,7 +59,6 @@ func Test_UserLibexecDirPath(t *testing.T) {
}
}


func TestLocalKeyPath(t *testing.T) {
userConfigDir = mockGetUserConfig
loadUserPath()
Expand Down

0 comments on commit 045ebb6

Please sign in to comment.