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