(t *testing.T)
| 252 | } |
| 253 | |
| 254 | func TestPrompt_expiring_stop(t *testing.T) { |
| 255 | ios, _, _, _ := iostreams.Test() |
| 256 | f := GitCredentialFlow{ |
| 257 | IO: ios, |
| 258 | Prompter: &prompter.PrompterMock{ |
| 259 | SelectFunc: func(_, _ string, options []string) (int, error) { |
| 260 | return slices.Index(options, "Cancel"), nil |
| 261 | }, |
| 262 | }, |
| 263 | HelperConfig: &stubHelperConfig{helper: gitcredentials.Helper{Cmd: "osxkeychain"}}, |
| 264 | } |
| 265 | |
| 266 | err := f.Prompt("github.com", true) |
| 267 | if !errors.Is(err, ErrExpiringSetupCredHelperCancelled) { |
| 268 | t.Errorf("Prompt() error = %v, want ErrExpiringSetupCredHelperCancelled", err) |
| 269 | } |
| 270 | if f.ShouldSetup() { |
| 271 | t.Error("ShouldSetup() = true, want false after stopping the sign-in") |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | func TestPrompt_expiring_alreadyOurs(t *testing.T) { |
| 276 | selectCalled := false |
nothing calls this directly
no test coverage detected