(opts ...TestClientOpt)
| 39 | } |
| 40 | |
| 41 | func NewTestClient(opts ...TestClientOpt) *Client { |
| 42 | apiClient := &hostScopedClient{ |
| 43 | hostname: "github.com", |
| 44 | Client: api.NewClientFromHTTP(http.DefaultClient), |
| 45 | } |
| 46 | io, _, _, _ := iostreams.Test() |
| 47 | c := &Client{ |
| 48 | apiClient: apiClient, |
| 49 | io: io, |
| 50 | prompter: nil, |
| 51 | } |
| 52 | |
| 53 | for _, o := range opts { |
| 54 | o(c) |
| 55 | } |
| 56 | return c |
| 57 | } |
| 58 | |
| 59 | type iprompter interface { |
| 60 | Select(string, string, []string) (int, error) |