diff options
Diffstat (limited to 'tests/push.rs')
| -rw-r--r-- | tests/push.rs | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/tests/push.rs b/tests/push.rs index e300fe2..8ef7a30 100644 --- a/tests/push.rs +++ b/tests/push.rs | |||
| @@ -109,7 +109,7 @@ mod when_branch_is_checked_out { | |||
| 109 | 109 | ||
| 110 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { | 110 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { |
| 111 | let (_, test_repo) = | 111 | let (_, test_repo) = |
| 112 | create_proposals_and_repo_with_first_proposal_pulled_and_checkedout()?; | 112 | create_proposals_and_repo_with_proposal_pulled_and_checkedout(1)?; |
| 113 | 113 | ||
| 114 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); | 114 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); |
| 115 | p.expect("fetching updates...\r\n")?; | 115 | p.expect("fetching updates...\r\n")?; |
| @@ -163,19 +163,13 @@ mod when_branch_is_checked_out { | |||
| 163 | 163 | ||
| 164 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { | 164 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { |
| 165 | let (_, test_repo) = | 165 | let (_, test_repo) = |
| 166 | create_proposals_and_repo_with_first_proposal_pulled_and_checkedout()?; | 166 | create_proposals_and_repo_with_proposal_pulled_and_checkedout(1)?; |
| 167 | 167 | ||
| 168 | // remove latest commit so it is behind | 168 | let branch_name = |
| 169 | let branch_name = test_repo.get_checked_out_branch_name()?; | 169 | remove_latest_commit_so_proposal_branch_is_behind_and_checkout_main( |
| 170 | test_repo.checkout("main")?; | 170 | &test_repo, |
| 171 | test_repo.git_repo.branch( | 171 | )?; |
| 172 | &branch_name, | 172 | |
| 173 | &test_repo | ||
| 174 | .git_repo | ||
| 175 | .find_commit(test_repo.get_tip_of_local_branch(&branch_name)?)? | ||
| 176 | .parent(0)?, | ||
| 177 | true, | ||
| 178 | )?; | ||
| 179 | test_repo.checkout(&branch_name)?; | 173 | test_repo.checkout(&branch_name)?; |
| 180 | // run test | 174 | // run test |
| 181 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); | 175 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); |
| @@ -235,7 +229,7 @@ mod when_branch_is_checked_out { | |||
| 235 | let cli_tester_handle = | 229 | let cli_tester_handle = |
| 236 | std::thread::spawn(move || -> Result<(GitTestRepo, GitTestRepo)> { | 230 | std::thread::spawn(move || -> Result<(GitTestRepo, GitTestRepo)> { |
| 237 | let (originating_repo, test_repo) = | 231 | let (originating_repo, test_repo) = |
| 238 | create_proposals_and_repo_with_first_proposal_pulled_and_checkedout()?; | 232 | create_proposals_and_repo_with_proposal_pulled_and_checkedout(1)?; |
| 239 | 233 | ||
| 240 | // add another commit (so we have an ammened local branch) | 234 | // add another commit (so we have an ammened local branch) |
| 241 | std::fs::write(test_repo.dir.join("ammended-commit.md"), "some content")?; | 235 | std::fs::write(test_repo.dir.join("ammended-commit.md"), "some content")?; |
| @@ -315,7 +309,7 @@ mod when_branch_is_checked_out { | |||
| 315 | 309 | ||
| 316 | let cli_tester_handle = std::thread::spawn(move || -> Result<GitTestRepo> { | 310 | let cli_tester_handle = std::thread::spawn(move || -> Result<GitTestRepo> { |
| 317 | let (_, test_repo) = | 311 | let (_, test_repo) = |
| 318 | create_proposals_and_repo_with_first_proposal_pulled_and_checkedout()?; | 312 | create_proposals_and_repo_with_proposal_pulled_and_checkedout(1)?; |
| 319 | 313 | ||
| 320 | // add another commit (so we have an ammened local branch) | 314 | // add another commit (so we have an ammened local branch) |
| 321 | std::fs::write(test_repo.dir.join("ammended-commit.md"), "some content")?; | 315 | std::fs::write(test_repo.dir.join("ammended-commit.md"), "some content")?; |
| @@ -398,7 +392,7 @@ mod when_branch_is_checked_out { | |||
| 398 | 392 | ||
| 399 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { | 393 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { |
| 400 | let (_, tmp_repo) = | 394 | let (_, tmp_repo) = |
| 401 | create_proposals_and_repo_with_first_proposal_pulled_and_checkedout()?; | 395 | create_proposals_and_repo_with_proposal_pulled_and_checkedout(1)?; |
| 402 | let branch_name = tmp_repo.get_checked_out_branch_name()?; | 396 | let branch_name = tmp_repo.get_checked_out_branch_name()?; |
| 403 | 397 | ||
| 404 | let test_repo = GitTestRepo::default(); | 398 | let test_repo = GitTestRepo::default(); |
| @@ -464,7 +458,7 @@ mod when_branch_is_checked_out { | |||
| 464 | 458 | ||
| 465 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { | 459 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { |
| 466 | let (_, tmp_repo) = | 460 | let (_, tmp_repo) = |
| 467 | create_proposals_and_repo_with_first_proposal_pulled_and_checkedout()?; | 461 | create_proposals_and_repo_with_proposal_pulled_and_checkedout(1)?; |
| 468 | let branch_name = tmp_repo.get_checked_out_branch_name()?; | 462 | let branch_name = tmp_repo.get_checked_out_branch_name()?; |
| 469 | 463 | ||
| 470 | let test_repo = GitTestRepo::default(); | 464 | let test_repo = GitTestRepo::default(); |