(t *testing.T)
| 41 | } |
| 42 | |
| 43 | func TestUpdateAddsNewCredentials(t *testing.T) { |
| 44 | // Given we have an isolated git config and we're using the built in store credential helper |
| 45 | // https://git-scm.com/docs/git-credential-store |
| 46 | withIsolatedGitConfig(t) |
| 47 | configureStoreCredentialHelper(t) |
| 48 | |
| 49 | // When we add new credentials |
| 50 | u := &gitcredentials.Updater{ |
| 51 | GitClient: &git.Client{}, |
| 52 | } |
| 53 | require.NoError(t, u.Update("github.com", "monalisa", "password")) |
| 54 | |
| 55 | // Then our credential description is successfully filled |
| 56 | require.Equal(t, heredoc.Doc(` |
| 57 | protocol=https |
| 58 | host=github.com |
| 59 | username=monalisa |
| 60 | password=password |
| 61 | `), fillCredentials(t)) |
| 62 | } |
| 63 | |
| 64 | func TestUpdateReplacesOldCredentials(t *testing.T) { |
| 65 | // Given we have an isolated git config and we're using the built in store credential helper |
nothing calls this directly
no test coverage detected