(t *testing.T)
| 868 | } |
| 869 | |
| 870 | func TestManager_Install_not_installable(t *testing.T) { |
| 871 | dataDir := t.TempDir() |
| 872 | updateDir := t.TempDir() |
| 873 | |
| 874 | reg := httpmock.Registry{} |
| 875 | defer reg.Verify(t) |
| 876 | client := http.Client{Transport: ®} |
| 877 | |
| 878 | ios, _, _, _ := iostreams.Test() |
| 879 | |
| 880 | m := newTestManager(dataDir, updateDir, &client, nil, ios) |
| 881 | |
| 882 | reg.Register( |
| 883 | httpmock.REST("GET", "repos/owner/gh-some-ext/releases/latest"), |
| 884 | httpmock.JSONResponse( |
| 885 | release{ |
| 886 | Assets: []releaseAsset{ |
| 887 | { |
| 888 | Name: "not-a-binary", |
| 889 | APIURL: "https://example.com/release/cool", |
| 890 | }, |
| 891 | }, |
| 892 | })) |
| 893 | reg.Register( |
| 894 | httpmock.REST("GET", "repos/owner/gh-some-ext/contents/gh-some-ext"), |
| 895 | httpmock.StatusStringResponse(404, "not found")) |
| 896 | |
| 897 | repo := ghrepo.New("owner", "gh-some-ext") |
| 898 | |
| 899 | err := m.Install(repo, "") |
| 900 | assert.EqualError(t, err, "extension is not installable: no usable release artifact or script found in owner/gh-some-ext") |
| 901 | } |
| 902 | |
| 903 | func TestManager_Install_git_pinned(t *testing.T) { |
| 904 | dataDir := t.TempDir() |
nothing calls this directly
no test coverage detected