Skip to content

Commit d24f33b

Browse files
committed
Add Test_RepoClone_flagError
1 parent 6e844fe commit d24f33b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/cmd/repo/clone/clone_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,13 @@ func Test_RepoClone_withoutUsername(t *testing.T) {
179179
assert.Equal(t, 1, cs.Count)
180180
assert.Equal(t, "git clone https://github.com/OWNER/REPO.git", strings.Join(cs.Calls[0].Args, " "))
181181
}
182+
183+
func Test_RepoClone_flagError(t *testing.T) {
184+
reg := &httpmock.Registry{}
185+
httpClient := &http.Client{Transport: reg}
186+
187+
_, err := runCloneCommand(httpClient, "--depth 1 OWNER/REPO")
188+
if err == nil || err.Error() != "unknown flag: --depth\nSeparate git clone flags with `--`." {
189+
t.Errorf("unexpected error %v", err)
190+
}
191+
}

0 commit comments

Comments
 (0)