mirror of
https://github.com/x-motemen/ghq.git
synced 2026-09-10 07:26:27 -04:00
add test for ghq.completeUser
This commit is contained in:
parent
d0a8b4be10
commit
9cbd420b5c
15
url_test.go
15
url_test.go
|
|
@ -45,7 +45,7 @@ func TestNewURL(t *testing.T) {
|
|||
expect: "https://golang.org/x/crypto",
|
||||
host: "golang.org",
|
||||
}, {
|
||||
name: "same name repository",
|
||||
name: "fill username",
|
||||
setup: func() func() {
|
||||
key := "GITHUB_USER"
|
||||
orig := os.Getenv(key)
|
||||
|
|
@ -55,6 +55,19 @@ func TestNewURL(t *testing.T) {
|
|||
url: "same-name-ghq",
|
||||
expect: "https://github.com/ghq-test/same-name-ghq",
|
||||
host: "github.com",
|
||||
}, {
|
||||
name: "same name repository",
|
||||
setup: func() func() {
|
||||
teardown, err := WithGitconfigFile(`[ghq]
|
||||
completeUser = false`)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return func() { teardown() }
|
||||
},
|
||||
url: "peco",
|
||||
expect: "https://github.com/peco/peco",
|
||||
host: "github.com",
|
||||
}}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
|
|
|||
Loading…
Reference in a new issue