1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00
goreleaser/internal/client/gitlab_test.go
Carlos Alexandro Becker 2e376ef378
chore(lint): enable revive
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-05-25 16:49:49 -03:00

33 lines
783 B
Go

package client
import (
"testing"
"github.com/goreleaser/goreleaser/pkg/config"
"github.com/goreleaser/goreleaser/pkg/context"
"github.com/stretchr/testify/require"
)
func TestGitLabReleaseURLTemplate(t *testing.T) {
ctx := context.New(config.Project{
GitLabURLs: config.GitLabURLs{
// default URL would otherwise be set via pipe/defaults
Download: DefaultGitLabDownloadURL,
},
Release: config.Release{
GitLab: config.Repo{
Owner: "owner",
Name: "name",
},
},
})
client, err := NewGitLab(ctx, ctx.Token)
require.NoError(t, err)
urlTpl, err := client.ReleaseURLTemplate(ctx)
require.NoError(t, err)
expectedURL := "https://gitlab.com/owner/name/-/releases/{{ .Tag }}/downloads/{{ .ArtifactName }}"
require.Equal(t, expectedURL, urlTpl)
}