2017-01-14 20:12:20 +02:00
|
|
|
package defaults
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestRepoName(t *testing.T) {
|
2017-04-14 20:53:36 +02:00
|
|
|
var assert = assert.New(t)
|
2017-03-23 02:01:29 +02:00
|
|
|
repo, err := remoteRepo()
|
2017-01-14 20:12:20 +02:00
|
|
|
assert.NoError(err)
|
2017-03-23 02:01:29 +02:00
|
|
|
assert.Equal("goreleaser/goreleaser", repo.String())
|
2017-01-14 20:12:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestExtractReporFromGitURL(t *testing.T) {
|
2017-04-14 20:53:36 +02:00
|
|
|
var assert = assert.New(t)
|
2017-03-23 02:01:29 +02:00
|
|
|
repo := extractRepoFromURL("git@github.com:goreleaser/goreleaser.git")
|
|
|
|
assert.Equal("goreleaser/goreleaser", repo.String())
|
2017-01-14 20:12:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestExtractReporFromHttpsURL(t *testing.T) {
|
2017-04-14 20:53:36 +02:00
|
|
|
var assert = assert.New(t)
|
2017-03-23 02:01:29 +02:00
|
|
|
repo := extractRepoFromURL("https://github.com/goreleaser/goreleaser.git")
|
|
|
|
assert.Equal("goreleaser/goreleaser", repo.String())
|
2017-01-14 20:12:20 +02:00
|
|
|
}
|