clear out any existing release assets
[#76848252] Signed-off-by: Chris Brown <cbrown@pivotal.io>
This commit is contained in:
@@ -63,9 +63,18 @@ var _ = Describe("Out Command", func() {
|
||||
})
|
||||
|
||||
Context("when the release has already been created", func() {
|
||||
existingAssets := []github.ReleaseAsset{
|
||||
{ID: github.Int(456789)},
|
||||
{ID: github.Int(3450798)},
|
||||
}
|
||||
|
||||
BeforeEach(func() {
|
||||
githubClient.ListReleasesReturns([]github.RepositoryRelease{
|
||||
{ID: github.Int(112), TagName: github.String("some-tag-name")},
|
||||
{
|
||||
ID: github.Int(112),
|
||||
TagName: github.String("some-tag-name"),
|
||||
Assets: existingAssets,
|
||||
},
|
||||
}, nil)
|
||||
|
||||
namePath := filepath.Join(sourcesDir, "name")
|
||||
@@ -92,6 +101,13 @@ var _ = Describe("Out Command", func() {
|
||||
Ω(*updatedRelease.Name).Should(Equal("v0.3.12"))
|
||||
Ω(*updatedRelease.Body).Should(Equal("this is a great release"))
|
||||
})
|
||||
|
||||
It("deletes the existing assets", func() {
|
||||
Ω(githubClient.DeleteReleaseAssetCallCount()).Should(Equal(2))
|
||||
|
||||
Ω(githubClient.DeleteReleaseAssetArgsForCall(0)).Should(Equal(existingAssets[0]))
|
||||
Ω(githubClient.DeleteReleaseAssetArgsForCall(1)).Should(Equal(existingAssets[1]))
|
||||
})
|
||||
})
|
||||
|
||||
Context("when the release has not already been created", func() {
|
||||
|
Reference in New Issue
Block a user