Add Test_RepoClone_flagError

This commit is contained in:
Shi Han NG 2020-08-01 19:23:28 +09:00
parent 6e844fef87
commit d24f33b679
No known key found for this signature in database
GPG key ID: 09FC1637248554BD

View file

@ -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)
}
}