(t *testing.T)
| 208 | } |
| 209 | |
| 210 | func TestNew_APIURL_dotcomFallback(t *testing.T) { |
| 211 | t.Setenv("GITHUB_API_URL", "") |
| 212 | f := &cmdutil.Factory{ |
| 213 | Config: func() (gh.Config, error) { |
| 214 | return nil, errors.New("Failed to load") |
| 215 | }, |
| 216 | } |
| 217 | api := New(f) |
| 218 | |
| 219 | if api.githubAPI != "https://api.github.com" { |
| 220 | t.Fatalf("expected https://api.github.com, got %s", api.githubAPI) |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | func TestNew_ServerURL_dotcomConfig(t *testing.T) { |
| 225 | t.Setenv("GITHUB_SERVER_URL", "") |