(t *testing.T)
| 105 | } |
| 106 | |
| 107 | func TestTokenStoredInEnv(t *testing.T) { |
| 108 | // When the user is authenticated via env var |
| 109 | authCfg := newTestAuthConfig(t) |
| 110 | t.Setenv("GH_TOKEN", "test-token") |
| 111 | |
| 112 | // When we get the token |
| 113 | cred := authCfg.ActiveToken("github.com") |
| 114 | token, source := cred.Token, cred.Source |
| 115 | |
| 116 | // Then the token is successfully fetched |
| 117 | // and the source is set to the name of the env var |
| 118 | require.Equal(t, "test-token", token) |
| 119 | require.Equal(t, "GH_TOKEN", source) |
| 120 | } |
| 121 | |
| 122 | func TestTokenStoredInKeyring(t *testing.T) { |
| 123 | // When the user has logged in securely |
nothing calls this directly
no test coverage detected