Add Test_RepoClone_flagError
This commit is contained in:
parent
6e844fef87
commit
d24f33b679
1 changed files with 10 additions and 0 deletions
|
|
@ -179,3 +179,13 @@ func Test_RepoClone_withoutUsername(t *testing.T) {
|
|||
assert.Equal(t, 1, cs.Count)
|
||||
assert.Equal(t, "git clone https://github.com/OWNER/REPO.git", strings.Join(cs.Calls[0].Args, " "))
|
||||
}
|
||||
|
||||
func Test_RepoClone_flagError(t *testing.T) {
|
||||
reg := &httpmock.Registry{}
|
||||
httpClient := &http.Client{Transport: reg}
|
||||
|
||||
_, err := runCloneCommand(httpClient, "--depth 1 OWNER/REPO")
|
||||
if err == nil || err.Error() != "unknown flag: --depth\nSeparate git clone flags with `--`." {
|
||||
t.Errorf("unexpected error %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue