Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
seachicken committed Sep 9, 2023
1 parent e763ca2 commit ef9790c
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions shared/remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert"
)

func Test_NewRemoteWithScpLikeUrl(t *testing.T) {
func Test_CreateRemoteWithScpLikeUrl(t *testing.T) {
assert.Equal(t,
Remote{
Name: "origin",
Expand All @@ -17,25 +17,36 @@ func Test_NewRemoteWithScpLikeUrl(t *testing.T) {
)
}

// https://github.com/seachicken/gh-poi/issues/39
func Test_NewRemoteWithCustomHostname(t *testing.T) {
func Test_CreateRemoteWithScpLikeUrlWithoutUserinfo(t *testing.T) {
assert.Equal(t,
Remote{
Name: "origin",
Hostname: "gitpro.ttaallkk.top-work",
Hostname: "github.com",
RepoName: "org/repo",
},
NewRemote("origin git@gitpro.ttaallkk.top-work:org/repo.git (fetch)"),
NewRemote("origin github.com:org/repo.git (fetch)"),
)
}

func Test_NewRemoteWithHttps(t *testing.T) {
func Test_CreateRemoteWithHttps(t *testing.T) {
assert.Equal(t,
Remote{
Name: "origin",
Hostname: "github.com",
RepoName: "org/repo",
},
NewRemote("origin https://github.com/org/repo (fetch)"),
NewRemote("origin https://github.com/org/repo.git (fetch)"),
)
}

// https://github.com/seachicken/gh-poi/issues/39
func Test_CreateRemoteWithCustomHostname(t *testing.T) {
assert.Equal(t,
Remote{
Name: "origin",
Hostname: "gitpro.ttaallkk.top-work",
RepoName: "org/repo",
},
NewRemote("origin git@gitpro.ttaallkk.top-work:org/repo.git (fetch)"),
)
}

0 comments on commit ef9790c

Please sign in to comment.