mirror of
https://github.com/x-motemen/ghq.git
synced 2026-09-10 07:26:27 -04:00
Add test
This commit is contained in:
parent
61e9f9e225
commit
28ef28dd33
|
|
@ -171,6 +171,19 @@ func TestCommandGet(t *testing.T) {
|
|||
Expect(cloneArgs.local).To(Equal(localDir))
|
||||
Expect(cloneArgs.shallow).To(Equal(true))
|
||||
})
|
||||
|
||||
withFakeGitBackend(t, func(tmpRoot string, cloneArgs *_cloneArgs, updateArgs *_updateArgs) {
|
||||
localDir := filepath.Join(tmpRoot, "github.com", "motemen")
|
||||
os.MkdirAll(localDir, 0755)
|
||||
wd, _ := os.Getwd()
|
||||
defer os.Chdir(wd)
|
||||
os.Chdir(localDir)
|
||||
|
||||
app.Run([]string{"", "get", "-u", "ghq-test-repo"})
|
||||
|
||||
Expect(cloneArgs.remote.String()).To(Equal("https://github.com/motemen/ghq-test-repo"))
|
||||
Expect(cloneArgs.local).To(Equal(filepath.Join(localDir, "ghq-test-repo")))
|
||||
})
|
||||
}
|
||||
|
||||
func TestCommandList(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue