Skip to content

Commit d051f06

Browse files
author
vilmibm
committed
update tests
1 parent 1fa3047 commit d051f06

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/cmd/repo/fork/fork_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func TestRepoFork_existing_remote_error(t *testing.T) {
104104
defer reg.StubWithFixturePath(200, "./forkResult.json")()
105105
httpClient := &http.Client{Transport: reg}
106106

107-
_, err := runCommand(httpClient, nil, false, "--remote")
107+
_, err := runCommand(httpClient, nil, true, "--remote")
108108
if err == nil {
109109
t.Fatal("expected error running command `repo fork`")
110110
}
@@ -114,7 +114,7 @@ func TestRepoFork_existing_remote_error(t *testing.T) {
114114
reg.Verify(t)
115115
}
116116

117-
func TestRepoFork_no_existing_remote(t *testing.T) {
117+
func TestRepoFork_no_conflicting_remote(t *testing.T) {
118118
remotes := []*context.Remote{
119119
{
120120
Remote: &git.Remote{
@@ -153,9 +153,10 @@ func TestRepoFork_in_parent_nontty(t *testing.T) {
153153
cs, restore := run.Stub()
154154
defer restore(t)
155155

156-
cs.Register(`git remote add -f fork https://github\.com/someone/REPO\.git`, 0, "")
156+
cs.Register("git remote rename origin upstream", 0, "")
157+
cs.Register(`git remote add -f origin https://github\.com/someone/REPO\.git`, 0, "")
157158

158-
output, err := runCommand(httpClient, nil, false, "--remote --remote-name=fork")
159+
output, err := runCommand(httpClient, nil, false, "--remote")
159160
if err != nil {
160161
t.Fatalf("error running command `repo fork`: %v", err)
161162
}

0 commit comments

Comments
 (0)