(t *testing.T)
| 796 | } |
| 797 | |
| 798 | func TestManager_Install_local_no_executable_found(t *testing.T) { |
| 799 | dataDir := t.TempDir() |
| 800 | updateDir := t.TempDir() |
| 801 | ios, _, stdout, stderr := iostreams.Test() |
| 802 | m := newTestManager(dataDir, updateDir, nil, nil, ios) |
| 803 | fakeExtensionName := "gh-local-ext" |
| 804 | |
| 805 | // Create a temporary directory to simulate the local extension repo |
| 806 | localDir := filepath.Join(dataDir, fakeExtensionName) |
| 807 | require.NoError(t, os.MkdirAll(localDir, 0755)) |
| 808 | |
| 809 | // Create a temporary directory to simulate the local extension update state |
| 810 | extensionUpdatePath := filepath.Join(updateDir, fakeExtensionName) |
| 811 | require.NoError(t, stubExtensionUpdate(extensionUpdatePath)) |
| 812 | |
| 813 | // Intentionally not creating an executable in the local extension repo |
| 814 | // to simulate an attempt to install a local extension without an executable |
| 815 | |
| 816 | err := m.InstallLocal(localDir) |
| 817 | require.ErrorAs(t, err, new(*ErrExtensionExecutableNotFound)) |
| 818 | assert.Equal(t, "", stdout.String()) |
| 819 | assert.Equal(t, "", stderr.String()) |
| 820 | require.NoDirExistsf(t, extensionUpdatePath, "update directory should be removed") |
| 821 | } |
| 822 | |
| 823 | func TestManager_Install_git(t *testing.T) { |
| 824 | dataDir := t.TempDir() |
nothing calls this directly
no test coverage detected