MCPcopy
hub / github.com/cli/cli / stubHomeDir

Function stubHomeDir

pkg/cmd/auth/login/login_test.go:25–34  ·  view source on GitHub ↗
(t *testing.T, dir string)

Source from the content-addressed store, hash-verified

23)
24
25func stubHomeDir(t *testing.T, dir string) {
26 homeEnv := "HOME"
27 switch runtime.GOOS {
28 case "windows":
29 homeEnv = "USERPROFILE"
30 case "plan9":
31 homeEnv = "home"
32 }
33 t.Setenv(homeEnv, dir)
34}
35
36func Test_NewCmdLogin(t *testing.T) {
37 tests := []struct {

Callers 1

Test_loginRun_SurveyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected