summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2023-04-02 21:04:52 +0200
committerJustin Wernick <justin@worthe-it.co.za>2023-04-02 21:04:52 +0200
commite5fef4f81679582cd6e55de3c8d4461fe712c997 (patch)
treed3455653f52261db8ccc0b42841a8d953f5d494b /tests
parent3a0452fb06c116de61ae75cf34931d4747c5953f (diff)
Start the basics of listing repos
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(())
}