(t *testing.T)
| 872 | } |
| 873 | |
| 874 | func TestManager_Install_local_no_executable_found(t *testing.T) { |
| 875 | dataDir := t.TempDir() |
| 876 | updateDir := t.TempDir() |
| 877 | ios, _, stdout, stderr := iostreams.Test() |
| 878 | m := newTestManager(dataDir, updateDir, nil, nil, ios) |
| 879 | fakeExtensionName := "gh-local-ext" |
| 880 | |
| 881 | // Create a temporary directory to simulate the local extension repo |
| 882 | localDir := filepath.Join(dataDir, fakeExtensionName) |
| 883 | require.NoError(t, os.MkdirAll(localDir, 0755)) |
| 884 | |
| 885 | // Create a temporary directory to simulate the local extension update state |
| 886 | extensionUpdatePath := filepath.Join(updateDir, fakeExtensionName) |
| 887 | require.NoError(t, stubExtensionUpdate(extensionUpdatePath)) |
| 888 | |
| 889 | // Intentionally not creating an executable in the local extension repo |
| 890 | // to simulate an attempt to install a local extension without an executable |
| 891 | |
| 892 | err := m.InstallLocal(localDir) |
| 893 | require.ErrorAs(t, err, new(*ErrExtensionExecutableNotFound)) |
| 894 | assert.Equal(t, "", stdout.String()) |
| 895 | assert.Equal(t, "", stderr.String()) |
| 896 | require.NoDirExistsf(t, extensionUpdatePath, "update directory should be removed") |
| 897 | } |
| 898 | |
| 899 | func TestManager_Install_git(t *testing.T) { |
| 900 | dataDir := t.TempDir() |
nothing calls this directly
no test coverage detected