(t *testing.T)
| 944 | } |
| 945 | |
| 946 | func TestManager_Install_not_installable(t *testing.T) { |
| 947 | dataDir := t.TempDir() |
| 948 | updateDir := t.TempDir() |
| 949 | |
| 950 | reg := httpmock.Registry{} |
| 951 | defer reg.Verify(t) |
| 952 | client := http.Client{Transport: ®} |
| 953 | |
| 954 | ios, _, _, _ := iostreams.Test() |
| 955 | |
| 956 | m := newTestManager(dataDir, updateDir, &client, nil, ios) |
| 957 | |
| 958 | reg.Register( |
| 959 | httpmock.REST("GET", "repos/owner/gh-some-ext/releases/latest"), |
| 960 | httpmock.JSONResponse( |
| 961 | release{ |
| 962 | Assets: []releaseAsset{ |
| 963 | { |
| 964 | Name: "not-a-binary", |
| 965 | APIURL: "https://example.com/release/cool", |
| 966 | }, |
| 967 | }, |
| 968 | })) |
| 969 | reg.Register( |
| 970 | httpmock.REST("GET", "repos/owner/gh-some-ext/contents/gh-some-ext"), |
| 971 | httpmock.StatusStringResponse(404, "not found")) |
| 972 | |
| 973 | repo := ghrepo.New("owner", "gh-some-ext") |
| 974 | |
| 975 | err := m.Install(repo, "") |
| 976 | assert.EqualError(t, err, "extension is not installable: no usable release artifact or script found in owner/gh-some-ext") |
| 977 | } |
| 978 | |
| 979 | func TestManager_Install_git_pinned(t *testing.T) { |
| 980 | dataDir := t.TempDir() |
nothing calls this directly
no test coverage detected