(t *testing.T)
| 47 | } |
| 48 | |
| 49 | func TestProfileResolveInteractive(t *testing.T) { |
| 50 | is := is.New(t) |
| 51 | |
| 52 | cfg := &storageMock{ |
| 53 | LenFunc: func() int { |
| 54 | return 2 |
| 55 | }, |
| 56 | NamesFunc: func() []string { |
| 57 | return []string{"home", "work"} |
| 58 | }, |
| 59 | } |
| 60 | |
| 61 | profile, err := profileResolve( |
| 62 | nil, |
| 63 | &bytes.Buffer{}, |
| 64 | &bytes.Buffer{}, |
| 65 | cfg, |
| 66 | func(names []string, _ io.Reader, _ io.Writer) (string, error) { |
| 67 | is.Equal(names, []string{"home", "work"}) |
| 68 | return "work", nil |
| 69 | }, |
| 70 | ) |
| 71 | |
| 72 | is.NoErr(err) |
| 73 | is.Equal(profile, "work") |
| 74 | } |
| 75 | |
| 76 | func TestProfileResolveInteractiveError(t *testing.T) { |
| 77 | is := is.New(t) |
nothing calls this directly
no test coverage detected