99 "testing"
1010 "time"
1111
12- "github.com/briandowns/spinner"
1312 "github.com/cli/cli/context"
1413 "github.com/cli/cli/git"
1514 "github.com/cli/cli/internal/config"
@@ -20,7 +19,6 @@ import (
2019 "github.com/cli/cli/pkg/iostreams"
2120 "github.com/cli/cli/pkg/prompt"
2221 "github.com/cli/cli/test"
23- "github.com/cli/cli/utils"
2422 "github.com/google/shlex"
2523 "github.com/stretchr/testify/assert"
2624)
@@ -155,7 +153,6 @@ func TestRepoFork_outside_parent_nontty(t *testing.T) {
155153}
156154
157155func TestRepoFork_already_forked (t * testing.T ) {
158- stubSpinner ()
159156 reg := & httpmock.Registry {}
160157 defer reg .StubWithFixturePath (200 , "./forkResult.json" )()
161158 httpClient := & http.Client {Transport : reg }
@@ -180,7 +177,6 @@ func TestRepoFork_already_forked(t *testing.T) {
180177}
181178
182179func TestRepoFork_reuseRemote (t * testing.T ) {
183- stubSpinner ()
184180 remotes := []* context.Remote {
185181 {
186182 Remote : & git.Remote {Name : "origin" , FetchURL : & url.URL {}},
@@ -208,7 +204,6 @@ func TestRepoFork_reuseRemote(t *testing.T) {
208204}
209205
210206func TestRepoFork_in_parent (t * testing.T ) {
211- stubSpinner ()
212207 reg := & httpmock.Registry {}
213208 defer reg .StubWithFixturePath (200 , "./forkResult.json" )()
214209 httpClient := & http.Client {Transport : reg }
@@ -234,7 +229,6 @@ func TestRepoFork_in_parent(t *testing.T) {
234229}
235230
236231func TestRepoFork_outside (t * testing.T ) {
237- stubSpinner ()
238232 tests := []struct {
239233 name string
240234 args string
@@ -273,7 +267,6 @@ func TestRepoFork_outside(t *testing.T) {
273267}
274268
275269func TestRepoFork_in_parent_yes (t * testing.T ) {
276- stubSpinner ()
277270 defer stubSince (2 * time .Second )()
278271 reg := & httpmock.Registry {}
279272 defer reg .StubWithFixturePath (200 , "./forkResult.json" )()
@@ -308,7 +301,6 @@ func TestRepoFork_in_parent_yes(t *testing.T) {
308301}
309302
310303func TestRepoFork_outside_yes (t * testing.T ) {
311- stubSpinner ()
312304 defer stubSince (2 * time .Second )()
313305 reg := & httpmock.Registry {}
314306 defer reg .StubWithFixturePath (200 , "./forkResult.json" )()
@@ -337,7 +329,6 @@ func TestRepoFork_outside_yes(t *testing.T) {
337329}
338330
339331func TestRepoFork_outside_survey_yes (t * testing.T ) {
340- stubSpinner ()
341332 defer stubSince (2 * time .Second )()
342333 reg := & httpmock.Registry {}
343334 defer reg .StubWithFixturePath (200 , "./forkResult.json" )()
@@ -368,7 +359,6 @@ func TestRepoFork_outside_survey_yes(t *testing.T) {
368359}
369360
370361func TestRepoFork_outside_survey_no (t * testing.T ) {
371- stubSpinner ()
372362 defer stubSince (2 * time .Second )()
373363 reg := & httpmock.Registry {}
374364 defer reg .StubWithFixturePath (200 , "./forkResult.json" )()
@@ -400,7 +390,6 @@ func TestRepoFork_outside_survey_no(t *testing.T) {
400390}
401391
402392func TestRepoFork_in_parent_survey_yes (t * testing.T ) {
403- stubSpinner ()
404393 reg := & httpmock.Registry {}
405394 defer reg .StubWithFixturePath (200 , "./forkResult.json" )()
406395 httpClient := & http.Client {Transport : reg }
@@ -438,7 +427,6 @@ func TestRepoFork_in_parent_survey_yes(t *testing.T) {
438427}
439428
440429func TestRepoFork_in_parent_survey_no (t * testing.T ) {
441- stubSpinner ()
442430 reg := & httpmock.Registry {}
443431 defer reg .StubWithFixturePath (200 , "./forkResult.json" )()
444432 httpClient := & http.Client {Transport : reg }
@@ -470,7 +458,6 @@ func TestRepoFork_in_parent_survey_no(t *testing.T) {
470458}
471459
472460func TestRepoFork_in_parent_match_protocol (t * testing.T ) {
473- stubSpinner ()
474461 defer stubSince (2 * time .Second )()
475462 reg := & httpmock.Registry {}
476463 defer reg .StubWithFixturePath (200 , "./forkResult.json" )()
@@ -513,14 +500,6 @@ func TestRepoFork_in_parent_match_protocol(t *testing.T) {
513500 reg .Verify (t )
514501}
515502
516- func stubSpinner () {
517- // not bothering with teardown since we never want spinners when doing tests
518- utils .StartSpinner = func (_ * spinner.Spinner ) {
519- }
520- utils .StopSpinner = func (_ * spinner.Spinner ) {
521- }
522- }
523-
524503func stubSince (d time.Duration ) func () {
525504 originalSince := Since
526505 Since = func (t time.Time ) time.Duration {
0 commit comments