(dataDir, updateDir string, client *http.Client, gitClient gitClient, ios *iostreams.IOStreams, extraEnv ...string)
| 46 | } |
| 47 | |
| 48 | func newTestManager(dataDir, updateDir string, client *http.Client, gitClient gitClient, ios *iostreams.IOStreams, extraEnv ...string) *Manager { |
| 49 | return &Manager{ |
| 50 | dataDir: func() string { return dataDir }, |
| 51 | updateDir: func() string { return updateDir }, |
| 52 | lookPath: func(exe string) (string, error) { return exe, nil }, |
| 53 | findSh: func() (string, error) { return "sh", nil }, |
| 54 | newCommand: func(exe string, args ...string) *exec.Cmd { |
| 55 | args = append([]string{os.Args[0], "-test.run=TestHelperProcess", "--", exe}, args...) |
| 56 | cmd := exec.Command(args[0], args[1:]...) |
| 57 | if ios != nil { |
| 58 | cmd.Stdout = ios.Out |
| 59 | cmd.Stderr = ios.ErrOut |
| 60 | } |
| 61 | cmd.Env = append([]string{"GH_WANT_HELPER_PROCESS=1"}, extraEnv...) |
| 62 | return cmd |
| 63 | }, |
| 64 | config: config.NewMockConfig(), |
| 65 | io: ios, |
| 66 | client: client, |
| 67 | gitClient: gitClient, |
| 68 | platform: func() (string, string) { |
| 69 | return "windows-amd64", ".exe" |
| 70 | }, |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | func TestManager_List(t *testing.T) { |
| 75 | dataDir := t.TempDir() |
no test coverage detected