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