}, } }) Context("with a commitish", func() { BeforeEach(func() { commitishPath := filepath.Join(sourcesDir, "commitish") file(commitishPath, "a2f4a3") request.Params.CommitishPath = "commitish" }) It("creates a release on GitHub with the commitish", func() { _, err := command.Run(sourcesDir, request) Ω(err).ShouldNot(HaveOccurred()) Ω(githubClient.CreateReleaseCallCount()).Should(Equal(1)) release := githubClient.CreateReleaseArgsForCall(0) Ω(release.TargetCommitish).Should(Equal(github.String("a2f4a3"))) }) }) Context("without a commitish", func() { It("creates a release on GitHub without the commitish", func() { _, err := command.Run(sourcesDir, request) Ω(err).ShouldNot(HaveOccurred()) Ω(githubClient.CreateReleaseCallCount()).Should(Equal(1)) release := githubClient.CreateReleaseArgsForCall(0) // GitHub treats empty string the same as not suppying the field.