add test for ghq.completeUser

This commit is contained in:
Songmu 2019-05-05 21:56:39 +09:00
parent d0a8b4be10
commit 9cbd420b5c

View file

@ -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 {