github.com/fredbi/git-chglog@v0.0.0-20190706071416-d35c598eac81/cmd/git-chglog/utils_test.go (about)

     1  package main
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestRemoteOriginURLToHTTP(t *testing.T) {
    10  	assert := assert.New(t)
    11  
    12  	table := [][]string{
    13  		{"git://github.com/owner0/repo0.git", "https://github.com/owner0/repo0"},
    14  		{"git@github.com:owner1/repo1.git", "https://github.com/owner1/repo1"},
    15  		{"git+ssh://git@github.com/owner2/repo2.git", "https://github.com/owner2/repo2"},
    16  		{"https://github.com/owner3/repo3.git", "https://github.com/owner3/repo3"},
    17  		{"", ""},
    18  	}
    19  
    20  	for _, v := range table {
    21  		assert.Equal(v[1], remoteOriginURLToHTTP(v[0]))
    22  	}
    23  }