From 7799b0edd16b0c97eb58ba2de62be27134a76122 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 23 Jan 2024 00:00:00 +0000 Subject: feat(prs-list): check for clean repo before checking out PR branch add confirm prompt before checking out branch and applying changes --- tests/prs_list.rs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/prs_list.rs b/tests/prs_list.rs index 7bc3935..7f753c0 100644 --- a/tests/prs_list.rs +++ b/tests/prs_list.rs @@ -141,7 +141,9 @@ mod when_main_branch_is_uptodate { ], )?; c.succeeds_with(0, true)?; - + let mut confirm = + p.expect_confirm_eventually("check out branch?", Some(true))?; + confirm.succeeds_with(None)?; p.expect_end_eventually_and_print()?; for p in [51, 52, 53, 55, 56] { @@ -200,6 +202,8 @@ mod when_main_branch_is_uptodate { )?; c.succeeds_with(0, true)?; p.expect("finding commits...\r\n")?; + let mut confirm = p.expect_confirm("check out branch?", Some(true))?; + confirm.succeeds_with(None)?; p.expect("checked out PR branch. pulled 2 new commits\r\n")?; p.expect_end()?; @@ -302,7 +306,9 @@ mod when_main_branch_is_uptodate { ], )?; c.succeeds_with(2, true)?; - + let mut confirm = + p.expect_confirm_eventually("check out branch?", Some(true))?; + confirm.succeeds_with(None)?; p.expect_end_eventually_and_print()?; for p in [51, 52, 53, 55, 56] { @@ -361,6 +367,8 @@ mod when_main_branch_is_uptodate { )?; c.succeeds_with(2, true)?; p.expect("finding commits...\r\n")?; + let mut confirm = p.expect_confirm("check out branch?", Some(true))?; + confirm.succeeds_with(None)?; p.expect("checked out PR branch. pulled 2 new commits\r\n")?; p.expect_end()?; @@ -478,6 +486,9 @@ mod when_main_branch_is_uptodate { ], )?; c.succeeds_with(0, true)?; + let mut confirm = + p.expect_confirm_eventually("check out branch?", Some(true))?; + confirm.succeeds_with(None)?; p.expect_end_eventually_and_print()?; for p in [51, 52, 53, 55, 56] { @@ -544,6 +555,8 @@ mod when_main_branch_is_uptodate { )?; c.succeeds_with(0, true)?; p.expect("finding commits...\r\n")?; + let mut confirm = p.expect_confirm("check out branch?", Some(true))?; + confirm.succeeds_with(None)?; p.expect("checked out PR branch. no new commits to pull\r\n")?; p.expect_end()?; @@ -632,7 +645,9 @@ mod when_main_branch_is_uptodate { ], )?; c.succeeds_with(0, true)?; - + let mut confirm = + p.expect_confirm_eventually("check out branch?", Some(true))?; + confirm.succeeds_with(None)?; p.expect_end_eventually_and_print()?; for p in [51, 52, 53, 55, 56] { @@ -699,6 +714,8 @@ mod when_main_branch_is_uptodate { )?; c.succeeds_with(0, true)?; p.expect("finding commits...\r\n")?; + let mut confirm = p.expect_confirm("check out branch?", Some(true))?; + confirm.succeeds_with(None)?; p.expect("checked out PR branch. pulled 1 new commits\r\n")?; p.expect_end()?; -- cgit v1.2.3