fix handling of redirect from asset download

This commit is contained in:
Alex Suraci
2016-07-09 18:32:35 -07:00
parent 12003714cf
commit 3a7443448e
72 changed files with 10743 additions and 680 deletions

View File

@@ -83,9 +83,25 @@ var _ = Describe("Out Command", func() {
}
BeforeEach(func() {
githubClient.ListReleasesReturns(existingReleases, nil)
githubClient.ListReleasesStub = func() ([]*github.RepositoryRelease, error) {
rels := []*github.RepositoryRelease{}
for _, r := range existingReleases {
c := r
rels = append(rels, &c)
}
githubClient.ListReleaseAssetsReturns(existingAssets, nil)
return rels, nil
}
githubClient.ListReleaseAssetsStub = func(github.RepositoryRelease) ([]*github.ReleaseAsset, error) {
assets := []*github.ReleaseAsset{}
for _, a := range existingAssets {
c := a
assets = append(assets, &c)
}
return assets, nil
}
namePath := filepath.Join(sourcesDir, "name")
bodyPath := filepath.Join(sourcesDir, "body")
@@ -396,7 +412,7 @@ var _ = Describe("Out Command", func() {
return nil
}
githubClient.ListReleaseAssetsReturns([]github.ReleaseAsset{
githubClient.ListReleaseAssetsReturns([]*github.ReleaseAsset{
{
ID: github.Int(456789),
Name: github.String("great-file.tgz"),