@@ -50,9 +50,9 @@ func TestPRCheckout_sameRepo(t *testing.T) {
5050 })
5151 defer restoreCmd ()
5252
53- RootCmd .SetArgs ([]string {"pr" , "checkout" , "123" })
54- _ , err := prCheckoutCmd .ExecuteC ()
53+ output , err := RunCommand (prCheckoutCmd , `pr checkout 123` )
5554 eq (t , err , nil )
55+ eq (t , output , "" )
5656
5757 eq (t , len (ranCommands ), 4 )
5858 eq (t , strings .Join (ranCommands [0 ], " " ), "git fetch origin +refs/heads/feature:refs/remotes/origin/feature" )
@@ -101,9 +101,9 @@ func TestPRCheckout_existingBranch(t *testing.T) {
101101 })
102102 defer restoreCmd ()
103103
104- RootCmd .SetArgs ([]string {"pr" , "checkout" , "123" })
105- _ , err := prCheckoutCmd .ExecuteC ()
104+ output , err := RunCommand (prCheckoutCmd , `pr checkout 123` )
106105 eq (t , err , nil )
106+ eq (t , output , "" )
107107
108108 eq (t , len (ranCommands ), 3 )
109109 eq (t , strings .Join (ranCommands [0 ], " " ), "git fetch origin +refs/heads/feature:refs/remotes/origin/feature" )
@@ -152,9 +152,9 @@ func TestPRCheckout_differentRepo_remoteExists(t *testing.T) {
152152 })
153153 defer restoreCmd ()
154154
155- RootCmd .SetArgs ([]string {"pr" , "checkout" , "123" })
156- _ , err := prCheckoutCmd .ExecuteC ()
155+ output , err := RunCommand (prCheckoutCmd , `pr checkout 123` )
157156 eq (t , err , nil )
157+ eq (t , output , "" )
158158
159159 eq (t , len (ranCommands ), 4 )
160160 eq (t , strings .Join (ranCommands [0 ], " " ), "git fetch robot-fork +refs/heads/feature:refs/remotes/robot-fork/feature" )
@@ -203,9 +203,9 @@ func TestPRCheckout_differentRepo(t *testing.T) {
203203 })
204204 defer restoreCmd ()
205205
206- RootCmd .SetArgs ([]string {"pr" , "checkout" , "123" })
207- _ , err := prCheckoutCmd .ExecuteC ()
206+ output , err := RunCommand (prCheckoutCmd , `pr checkout 123` )
208207 eq (t , err , nil )
208+ eq (t , output , "" )
209209
210210 eq (t , len (ranCommands ), 4 )
211211 eq (t , strings .Join (ranCommands [0 ], " " ), "git fetch origin refs/pull/123/head:feature" )
@@ -254,9 +254,9 @@ func TestPRCheckout_differentRepo_existingBranch(t *testing.T) {
254254 })
255255 defer restoreCmd ()
256256
257- RootCmd .SetArgs ([]string {"pr" , "checkout" , "123" })
258- _ , err := prCheckoutCmd .ExecuteC ()
257+ output , err := RunCommand (prCheckoutCmd , `pr checkout 123` )
259258 eq (t , err , nil )
259+ eq (t , output , "" )
260260
261261 eq (t , len (ranCommands ), 2 )
262262 eq (t , strings .Join (ranCommands [0 ], " " ), "git fetch origin refs/pull/123/head:feature" )
@@ -303,9 +303,9 @@ func TestPRCheckout_differentRepo_currentBranch(t *testing.T) {
303303 })
304304 defer restoreCmd ()
305305
306- RootCmd .SetArgs ([]string {"pr" , "checkout" , "123" })
307- _ , err := prCheckoutCmd .ExecuteC ()
306+ output , err := RunCommand (prCheckoutCmd , `pr checkout 123` )
308307 eq (t , err , nil )
308+ eq (t , output , "" )
309309
310310 eq (t , len (ranCommands ), 2 )
311311 eq (t , strings .Join (ranCommands [0 ], " " ), "git fetch origin refs/pull/123/head" )
@@ -352,9 +352,9 @@ func TestPRCheckout_maintainerCanModify(t *testing.T) {
352352 })
353353 defer restoreCmd ()
354354
355- RootCmd .SetArgs ([]string {"pr" , "checkout" , "123" })
356- _ , err := prCheckoutCmd .ExecuteC ()
355+ output , err := RunCommand (prCheckoutCmd , `pr checkout 123` )
357356 eq (t , err , nil )
357+ eq (t , output , "" )
358358
359359 eq (t , len (ranCommands ), 4 )
360360 eq (t , strings .Join (ranCommands [0 ], " " ), "git fetch origin refs/pull/123/head:feature" )
0 commit comments