From e5fef4f81679582cd6e55de3c8d4461fe712c997 Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Sun, 2 Apr 2023 21:04:52 +0200 Subject: Start the basics of listing repos --- tests/cli.rs | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/cli.rs b/tests/cli.rs index aa25e0a..648b6c1 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -229,19 +229,33 @@ fn allows_single_quotes_and_spaces_inside_double_quotes() -> Result<()> { fn list_can_print_an_empty_list() -> Result<()> { let mut c = spawn_interactive_process()?; c.p.send_line("list")?; - c.p.exp_string( - r" ----------------------- -| path | description | -====================== ----------------------- -", - )?; + c.p.exp_string("+------+-------------+")?; + c.p.exp_string("| path | description |")?; + c.p.exp_string("+====================+")?; + c.p.exp_string("+------+-------------+")?; + expect_prompt(&mut c.p)?; + Ok(()) } #[test] -#[ignore] fn list_can_print_an_list_of_all_repos_with_descriptions() -> Result<()> { - todo!() + let mut c = spawn_interactive_process()?; + let personal_repo_name = "my-personal-repo"; + c.p.send_line(&format!("git-init {}", personal_repo_name))?; + + let group = get_user_groups().pop().unwrap(); + let shared_repo_name = "my-shared-repo"; + c.p.send_line(&format!("git-init --group {} {}", group, shared_repo_name))?; + + c.p.send_line("list")?; + c.p.exp_string("+------+-------------+")?; + c.p.exp_string("| path | description |")?; + c.p.exp_string("+====================+")?; + c.p.exp_string("| git/shukkie/my-personal-repo | |+")?; + c.p.exp_string(&format!("| git/{group}/{shared_repo_name} | |+"))?; + c.p.exp_string("+------+-------------+")?; + expect_prompt(&mut c.p)?; + + Ok(()) } -- cgit v1.2.3