MCPcopy Create free account
hub / github.com/cli/cli / TestDefaultHostFromEnvVar

Function TestDefaultHostFromEnvVar

internal/config/auth_config_test.go:213–224  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

211}
212
213func TestDefaultHostFromEnvVar(t *testing.T) {
214 // Given the GH_HOST env var is set
215 authCfg := newTestAuthConfig(t)
216 t.Setenv("GH_HOST", "ghe.io")
217
218 // When we get the DefaultHost
219 defaultHost, source := authCfg.DefaultHost()
220
221 // Then the returned host and source are using the env var
222 require.Equal(t, "ghe.io", defaultHost)
223 require.Equal(t, "GH_HOST", source)
224}
225
226func TestDefaultHostNotLoggedIn(t *testing.T) {
227 // Given we are not logged in

Callers

nothing calls this directly

Calls 3

newTestAuthConfigFunction · 0.85
EqualMethod · 0.80
DefaultHostMethod · 0.65

Tested by

no test coverage detected