From 2c983efe18b5b24f1d839119ca56548d816745a4 Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Wed, 19 Apr 2023 17:54:51 +0200 Subject: Added some missing expected output in the listing tests These were sometimes timing out a bit early and looking at the wrong output. --- tests/cli.rs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/cli.rs b/tests/cli.rs index 320b4d6..3787bfc 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -267,14 +267,19 @@ fn list_can_print_an_empty_list() -> Result<()> { #[test] fn list_can_print_a_list_of_personal_repos_with_descriptions() -> Result<()> { let mut c = spawn_interactive_process()?; - let user = get_username().unwrap(); - let personal_repo_name = "my-personal-repo"; - c.p.send_line(&format!("init {}", personal_repo_name))?; + let username = get_username().unwrap(); + let repo_name = "my-personal-repo"; + c.p.send_line(&format!("init {}", repo_name))?; + c.p.exp_string(&format!( + "Successfully created \"git/{}/{}.git\"", + username, repo_name + ))?; + expect_prompt(&mut c.p)?; expect_list_table( &mut c, &[( - format!("git/{user}/{personal_repo_name}.git"), + format!("git/{username}/{repo_name}.git"), DEFAULT_DESCRIPTION.to_owned(), )], )?; @@ -285,19 +290,29 @@ fn list_can_print_a_list_of_personal_repos_with_descriptions() -> Result<()> { #[test] fn list_can_print_a_list_of_all_repos_with_descriptions() -> Result<()> { let mut c = spawn_interactive_process()?; - let user = get_username().unwrap(); + let username = get_username().unwrap(); let personal_repo_name = "my-personal-repo"; c.p.send_line(&format!("init {}", personal_repo_name))?; + c.p.exp_string(&format!( + "Successfully created \"git/{}/{}.git\"", + username, personal_repo_name + ))?; + expect_prompt(&mut c.p)?; let group = get_user_groups().into_iter().next().unwrap(); let shared_repo_name = "my-shared-repo"; c.p.send_line(&format!("init --group {} {}", group, shared_repo_name))?; + c.p.exp_string(&format!( + "Successfully created \"git/{}/{}.git\"", + group, shared_repo_name + ))?; + expect_prompt(&mut c.p)?; expect_list_table( &mut c, &[ ( - format!("git/{user}/{personal_repo_name}.git"), + format!("git/{username}/{personal_repo_name}.git"), DEFAULT_DESCRIPTION.to_owned(), ), ( -- cgit v1.2.3