"*.tgz", }, }, } bodyPath := filepath.Join(sourcesDir, "body") file(bodyPath, "*markdown*") request.Params.BodyPath = "body" }) It("uploads matching file globs", func() { _, err := command.Run(sourcesDir, request) Ω(err).ShouldNot(HaveOccurred()) Ω(githubClient.UploadReleaseAssetCallCount()).Should(Equal(1)) release, name, file := githubClient.UploadReleaseAssetArgsForCall(0) Ω(*release.ID).Should(Equal(112)) Ω(name).Should(Equal("great-file.tgz")) Ω(file.Name()).Should(Equal(filepath.Join(sourcesDir, "great-file.tgz"))) }) It("has some sweet metadata", func() { outResponse, err := command.Run(sourcesDir, request) Ω(err).ShouldNot(HaveOccurred()) Ω(outResponse.Metadata).Should(ConsistOf( resource.MetadataPair{Name: "url", Value: "http://google.com"}, resource.MetadataPair{Name: "name", Value: "release-name", URL: "http://google.com"}, resource.MetadataPair{Name: "body", Value: "*markdown*", Markdown: true}, resource.MetadataPair{Name: "tag", Value: "0.3.12"},
TagPath: "tag", Globs: []string{ "*.tgz", }, }, } bodyPath := filepath.Join(sourcesDir, "body") file(bodyPath, "*markdown*") request.Params.BodyPath = "body" }) It("uploads matching file globs", func() { Ω(githubClient.UploadReleaseAssetCallCount()).Should(Equal(1)) release, name, file := githubClient.UploadReleaseAssetArgsForCall(0) Ω(*release.ID).Should(Equal(112)) Ω(name).Should(Equal("great-file.tgz")) Ω(file.Name()).Should(Equal(filepath.Join(sourcesDir, "great-file.tgz"))) }) It("has some sweet metadata", func() { outResponse, err := command.Run(sourcesDir, request) Ω(err).ShouldNot(HaveOccurred()) Ω(outResponse.Metadata).Should(ConsistOf( resource.MetadataPair{Name: "url", Value: "http://google.com"}, resource.MetadataPair{Name: "name", Value: "release-name", URL: "http://google.com"}, resource.MetadataPair{Name: "body", Value: "*markdown*", Markdown: true}, ))