本文整理匯總了Golang中github.com/concourse/github-release-resource/fakes.FakeGitHub.UpdateReleaseStub方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeGitHub.UpdateReleaseStub方法的具體用法?Golang FakeGitHub.UpdateReleaseStub怎麽用?Golang FakeGitHub.UpdateReleaseStub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/concourse/github-release-resource/fakes.FakeGitHub
的用法示例。
在下文中一共展示了FakeGitHub.UpdateReleaseStub方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
command = resource.NewOutCommand(githubClient, ioutil.Discard)
sourcesDir, err = ioutil.TempDir("", "github-release")
Ω(err).ShouldNot(HaveOccurred())
githubClient.CreateReleaseStub = func(gh github.RepositoryRelease) (*github.RepositoryRelease, error) {
createdRel := gh
createdRel.ID = github.Int(112)
createdRel.HTMLURL = github.String("http://google.com")
createdRel.Name = github.String("release-name")
createdRel.Body = github.String("*markdown*")
return &createdRel, nil
}
githubClient.UpdateReleaseStub = func(gh github.RepositoryRelease) (*github.RepositoryRelease, error) {
return &gh, nil
}
})
AfterEach(func() {
Ω(os.RemoveAll(sourcesDir)).Should(Succeed())
})
Context("when the release has already been created", func() {
existingAssets := []github.ReleaseAsset{
{
ID: github.Int(456789),
Name: github.String("unicorns.txt"),
},
{
ID: github.Int(3450798),