summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2023-04-19 17:54:51 +0200
committerJustin Wernick <justin@worthe-it.co.za>2023-04-19 17:54:51 +0200
commit2c983efe18b5b24f1d839119ca56548d816745a4 (patch)
treef8c2b807e880cc3ac533cfe4aa77b69544de4643
parent2b3a71cea9f8ce9d7396aad901e23b49da48cccd (diff)
Added some missing expected output in the listing tests
These were sometimes timing out a bit early and looking at the wrong output.
-rw-r--r--tests/cli.rs27
1 files changed, 21 insertions, 6 deletions
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(),
),
(