support draft releases for in and out

* in will pull in the latest release, even if draft. It will not create
  the files `tag` and `version`, if no tag is defined on the draft
  release.
* out will push a release in a draft state when provided as a param

[#102513822]

Signed-off-by: David Morhovich <dmorhovich@pivotal.io>
This commit is contained in:
JT Archie
2015-10-20 17:47:08 -04:00
committed by David Morhovich
parent a7eb775171
commit b2eee37237
5 changed files with 122 additions and 12 deletions

View File

@@ -205,6 +205,31 @@ var _ = Describe("Out Command", func() {
})
})
It("always defaults to non-draft mode", func() {
Ω(githubClient.CreateReleaseCallCount()).Should(Equal(1))
release := githubClient.CreateReleaseArgsForCall(0)
Ω(*release.Draft).Should(Equal(false))
})
Context("when set as a draft release", func() {
BeforeEach(func() {
bodyPath := filepath.Join(sourcesDir, "body")
file(bodyPath, "this is a great release")
request.Params.Draft = true
})
It("creates a release on GitHub in draft mode", func() {
Ω(githubClient.CreateReleaseCallCount()).Should(Equal(1))
release := githubClient.CreateReleaseArgsForCall(0)
Ω(*release.Name).Should(Equal("v0.3.12"))
Ω(*release.TagName).Should(Equal("0.3.12"))
Ω(*release.Body).Should(Equal(""))
Ω(*release.Draft).Should(Equal(true))
})
})
Context("with file globs", func() {
BeforeEach(func() {
globMatching := filepath.Join(sourcesDir, "great-file.tgz")