1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/pipeline/release/remote_test.go
Carlos Alexandro Becker 10c6df73c0
chore: more cleanup
2017-12-18 09:00:19 -02:00

29 lines
774 B
Go

package release
import (
"testing"
"github.com/goreleaser/goreleaser/internal/testlib"
"github.com/stretchr/testify/assert"
)
func TestRepoName(t *testing.T) {
_, back := testlib.Mktmp(t)
defer back()
testlib.GitInit(t)
testlib.GitRemoteAdd(t, "git@github.com:goreleaser/goreleaser.git")
repo, err := remoteRepo()
assert.NoError(t, err)
assert.Equal(t, "goreleaser/goreleaser", repo.String())
}
func TestExtractReporFromGitURL(t *testing.T) {
repo := extractRepoFromURL("git@github.com:goreleaser/goreleaser.git")
assert.Equal(t, "goreleaser/goreleaser", repo.String())
}
func TestExtractReporFromHttpsURL(t *testing.T) {
repo := extractRepoFromURL("https://github.com/goreleaser/goreleaser.git")
assert.Equal(t, "goreleaser/goreleaser", repo.String())
}