summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cli.rs34
1 files changed, 24 insertions, 10 deletions
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(())
}