(t *testing.T)
| 192 | } |
| 193 | |
| 194 | func TestManager_Remove(t *testing.T) { |
| 195 | dataDir := t.TempDir() |
| 196 | updateDir := t.TempDir() |
| 197 | assert.NoError(t, stubExtension(filepath.Join(dataDir, "extensions", "gh-hello", "gh-hello"))) |
| 198 | assert.NoError(t, stubExtensionUpdate(filepath.Join(updateDir, "gh-hello"))) |
| 199 | assert.NoError(t, stubExtension(filepath.Join(dataDir, "extensions", "gh-two", "gh-two"))) |
| 200 | |
| 201 | m := newTestManager(dataDir, updateDir, nil, nil, nil) |
| 202 | err := m.Remove("hello") |
| 203 | assert.NoError(t, err) |
| 204 | |
| 205 | items, err := os.ReadDir(filepath.Join(dataDir, "extensions")) |
| 206 | assert.NoError(t, err) |
| 207 | assert.Equal(t, 1, len(items)) |
| 208 | assert.Equal(t, "gh-two", items[0].Name()) |
| 209 | |
| 210 | assert.NoDirExistsf(t, filepath.Join(updateDir, "gh-hello"), "update directory should be removed") |
| 211 | } |
| 212 | |
| 213 | func TestManager_Upgrade_NoExtensions(t *testing.T) { |
| 214 | dataDir := t.TempDir() |
nothing calls this directly
no test coverage detected