(t *testing.T)
| 167 | } |
| 168 | |
| 169 | func TestManager_Dispatch_binary(t *testing.T) { |
| 170 | dataDir := t.TempDir() |
| 171 | updateDir := t.TempDir() |
| 172 | extPath := filepath.Join(dataDir, "extensions", "gh-hello") |
| 173 | exePath := filepath.Join(extPath, "gh-hello") |
| 174 | bm := binManifest{ |
| 175 | Owner: "owner", |
| 176 | Name: "gh-hello", |
| 177 | Host: "github.com", |
| 178 | Tag: "v1.0.0", |
| 179 | } |
| 180 | assert.NoError(t, stubBinaryExtension(extPath, bm)) |
| 181 | |
| 182 | m := newTestManager(dataDir, updateDir, nil, nil, nil) |
| 183 | |
| 184 | stdout := &bytes.Buffer{} |
| 185 | stderr := &bytes.Buffer{} |
| 186 | found, err := m.Dispatch([]string{"hello", "one", "two"}, nil, stdout, stderr) |
| 187 | assert.NoError(t, err) |
| 188 | assert.True(t, found) |
| 189 | |
| 190 | assert.Equal(t, fmt.Sprintf("[%s one two]\n", exePath), stdout.String()) |
| 191 | assert.Equal(t, "", stderr.String()) |
| 192 | } |
| 193 | |
| 194 | func TestManager_Remove(t *testing.T) { |
| 195 | dataDir := t.TempDir() |
nothing calls this directly
no test coverage detected