(t *testing.T)
| 274 | } |
| 275 | |
| 276 | func Test_runBrowse(t *testing.T) { |
| 277 | s := string(os.PathSeparator) |
| 278 | t.Setenv("GIT_DIR", "../../../git/fixtures/simple.git") |
| 279 | tests := []struct { |
| 280 | name string |
| 281 | opts BrowseOptions |
| 282 | httpStub func(*httpmock.Registry) |
| 283 | baseRepo ghrepo.Interface |
| 284 | defaultBranch string |
| 285 | expectedURL string |
| 286 | wantsErr bool |
| 287 | }{ |
| 288 | { |
| 289 | name: "no arguments", |
| 290 | opts: BrowseOptions{ |
| 291 | SelectorArg: "", |
| 292 | }, |
| 293 | baseRepo: ghrepo.New("jlsestak", "cli"), |
| 294 | expectedURL: "https://github.com/jlsestak/cli", |
| 295 | }, |
| 296 | { |
| 297 | name: "settings flag", |
| 298 | opts: BrowseOptions{ |
| 299 | SettingsFlag: true, |
| 300 | }, |
| 301 | baseRepo: ghrepo.New("bchadwic", "ObscuredByClouds"), |
| 302 | expectedURL: "https://github.com/bchadwic/ObscuredByClouds/settings", |
| 303 | }, |
| 304 | { |
| 305 | name: "projects flag", |
| 306 | opts: BrowseOptions{ |
| 307 | ProjectsFlag: true, |
| 308 | }, |
| 309 | baseRepo: ghrepo.New("ttran112", "7ate9"), |
| 310 | expectedURL: "https://github.com/ttran112/7ate9/projects", |
| 311 | }, |
| 312 | { |
| 313 | name: "releases flag", |
| 314 | opts: BrowseOptions{ |
| 315 | ReleasesFlag: true, |
| 316 | }, |
| 317 | baseRepo: ghrepo.New("ttran112", "7ate9"), |
| 318 | expectedURL: "https://github.com/ttran112/7ate9/releases", |
| 319 | }, |
| 320 | { |
| 321 | name: "wiki flag", |
| 322 | opts: BrowseOptions{ |
| 323 | WikiFlag: true, |
| 324 | }, |
| 325 | baseRepo: ghrepo.New("ravocean", "ThreatLevelMidnight"), |
| 326 | expectedURL: "https://github.com/ravocean/ThreatLevelMidnight/wiki", |
| 327 | }, |
| 328 | { |
| 329 | name: "actions flag", |
| 330 | opts: BrowseOptions{ |
| 331 | ActionsFlag: true, |
| 332 | }, |
| 333 | baseRepo: ghrepo.New("ravocean", "ThreatLevelMidnight"), |
nothing calls this directly
no test coverage detected