1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-05 00:59:04 +02:00

refactor: align Homebrew repo handling with Scoop (#1649)

This commit is contained in:
Radek Simko
2020-07-06 14:48:17 +01:00
committed by GitHub
parent 345b91703a
commit 998e377627
28 changed files with 311 additions and 264 deletions

View File

@ -56,6 +56,29 @@ func TestGitHubUploadReleaseIDNotInt(t *testing.T) {
)
}
func TestGitHubReleaseURLTemplate(t *testing.T) {
var ctx = context.New(config.Project{
GitHubURLs: config.GitHubURLs{
// default URL would otherwise be set via pipe/defaults
Download: DefaultGitHubDownloadURL,
},
Release: config.Release{
GitHub: config.Repo{
Owner: "owner",
Name: "name",
},
},
})
client, err := NewGitHub(ctx)
require.NoError(t, err)
urlTpl, err := client.ReleaseURLTemplate(ctx)
require.NoError(t, err)
expectedUrl := "https://github.com/owner/name/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
require.Equal(t, expectedUrl, urlTpl)
}
func TestGitHubCreateReleaseWrongNameTemplate(t *testing.T) {
var ctx = context.New(config.Project{
Release: config.Release{