(t *testing.T)
| 222 | } |
| 223 | |
| 224 | func TestNew_ServerURL_dotcomConfig(t *testing.T) { |
| 225 | t.Setenv("GITHUB_SERVER_URL", "") |
| 226 | t.Setenv("GITHUB_API_URL", "https://api.github.com") |
| 227 | cfg := &ghmock.ConfigMock{ |
| 228 | AuthenticationFunc: func() gh.AuthConfig { |
| 229 | return &config.AuthConfig{} |
| 230 | }, |
| 231 | } |
| 232 | f := &cmdutil.Factory{ |
| 233 | Config: func() (gh.Config, error) { |
| 234 | return cfg, nil |
| 235 | }, |
| 236 | } |
| 237 | api := New(f) |
| 238 | |
| 239 | if api.githubServer != "https://github.com" { |
| 240 | t.Fatalf("expected https://github.com, got %s", api.githubServer) |
| 241 | } |
| 242 | if len(cfg.AuthenticationCalls()) != 1 { |
| 243 | t.Fatalf("Server url was not pulled from the config") |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | func TestNew_ServerURL_customConfig(t *testing.T) { |
| 248 | t.Setenv("GITHUB_SERVER_URL", "") |
nothing calls this directly
no test coverage detected