Fixed test for stdout in non-tty use case of repo fork
This commit is contained in:
parent
8dbbceaaaf
commit
efec5d9250
1 changed files with 7 additions and 0 deletions
|
|
@ -390,6 +390,7 @@ func TestRepoFork(t *testing.T) {
|
|||
},
|
||||
},
|
||||
httpStubs: forkPost,
|
||||
wantOut: "https://github.com/someone/REPO\n",
|
||||
},
|
||||
{
|
||||
name: "implicit nontty remote exists",
|
||||
|
|
@ -424,11 +425,13 @@ func TestRepoFork(t *testing.T) {
|
|||
cs.Register("git remote rename origin upstream", 0, "")
|
||||
cs.Register(`git remote add origin https://github.com/someone/REPO.git`, 0, "")
|
||||
},
|
||||
wantOut: "https://github.com/someone/REPO\n",
|
||||
},
|
||||
{
|
||||
name: "implicit nontty no args",
|
||||
opts: &ForkOptions{},
|
||||
httpStubs: forkPost,
|
||||
wantOut: "https://github.com/someone/REPO\n",
|
||||
},
|
||||
{
|
||||
name: "passes git flags",
|
||||
|
|
@ -561,6 +564,7 @@ func TestRepoFork(t *testing.T) {
|
|||
Repository: "OWNER/REPO",
|
||||
},
|
||||
httpStubs: forkPost,
|
||||
wantOut: "https://github.com/someone/REPO\n",
|
||||
},
|
||||
{
|
||||
name: "repo arg nontty repo already exists",
|
||||
|
|
@ -604,6 +608,7 @@ func TestRepoFork(t *testing.T) {
|
|||
cs.Register(`git -C REPO fetch upstream`, 0, "")
|
||||
cs.Register(`git -C REPO config --add remote.upstream.gh-resolved base`, 0, "")
|
||||
},
|
||||
wantOut: "https://github.com/someone/REPO\n",
|
||||
},
|
||||
{
|
||||
name: "non tty repo arg with fork-name",
|
||||
|
|
@ -640,6 +645,7 @@ func TestRepoFork(t *testing.T) {
|
|||
httpmock.StringResponse(renameResult))
|
||||
},
|
||||
wantErrOut: "",
|
||||
wantOut: "https://github.com/OWNER/REPO\n",
|
||||
},
|
||||
{
|
||||
name: "tty repo arg with fork-name",
|
||||
|
|
@ -694,6 +700,7 @@ func TestRepoFork(t *testing.T) {
|
|||
cs.Register(`git -C REPO fetch upstream`, 0, "")
|
||||
cs.Register(`git -C REPO config --add remote.upstream.gh-resolved base`, 0, "")
|
||||
},
|
||||
wantOut: "https://github.com/someone/REPO\n",
|
||||
},
|
||||
{
|
||||
name: "does not retry clone if error occurs and exit code is not 128",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue