diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ngit_init.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/ngit_init.rs b/tests/ngit_init.rs index 34a6ab4..da4091f 100644 --- a/tests/ngit_init.rs +++ b/tests/ngit_init.rs | |||
| @@ -11,6 +11,15 @@ fn expect_msgs_first(p: &mut CliTester) -> Result<()> { | |||
| 11 | Ok(()) | 11 | Ok(()) |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | fn expect_prompt_to_set_origin(p: &mut CliTester) -> Result<()> { | ||
| 15 | p.expect_confirm_eventually( | ||
| 16 | "set remote \"origin\" to the nostr url of your repository?", | ||
| 17 | Some(true), | ||
| 18 | )? | ||
| 19 | .succeeds_with(Some(false))?; | ||
| 20 | Ok(()) | ||
| 21 | } | ||
| 22 | |||
| 14 | fn get_cli_args() -> Vec<&'static str> { | 23 | fn get_cli_args() -> Vec<&'static str> { |
| 15 | vec![ | 24 | vec![ |
| 16 | "--nsec", | 25 | "--nsec", |
| @@ -96,6 +105,7 @@ mod when_repo_not_previously_claimed { | |||
| 96 | // // check relay had the right number of events | 105 | // // check relay had the right number of events |
| 97 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { | 106 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { |
| 98 | let mut p = cli_tester_init(&git_repo); | 107 | let mut p = cli_tester_init(&git_repo); |
| 108 | expect_prompt_to_set_origin(&mut p)?; | ||
| 99 | p.expect_end_eventually()?; | 109 | p.expect_end_eventually()?; |
| 100 | for p in [51, 52, 53, 55, 56, 57] { | 110 | for p in [51, 52, 53, 55, 56, 57] { |
| 101 | relay::shutdown_relay(8000 + p)?; | 111 | relay::shutdown_relay(8000 + p)?; |
| @@ -222,6 +232,7 @@ mod when_repo_not_previously_claimed { | |||
| 222 | // // check relay had the right number of events | 232 | // // check relay had the right number of events |
| 223 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { | 233 | let cli_tester_handle = std::thread::spawn(move || -> Result<()> { |
| 224 | let mut p = cli_tester_init(&git_repo); | 234 | let mut p = cli_tester_init(&git_repo); |
| 235 | expect_prompt_to_set_origin(&mut p)?; | ||
| 225 | p.expect_end_eventually()?; | 236 | p.expect_end_eventually()?; |
| 226 | for p in [51, 52, 53, 55, 56, 57] { | 237 | for p in [51, 52, 53, 55, 56, 57] { |
| 227 | relay::shutdown_relay(8000 + p)?; | 238 | relay::shutdown_relay(8000 + p)?; |
| @@ -494,7 +505,8 @@ mod when_repo_not_previously_claimed { | |||
| 494 | ], | 505 | ], |
| 495 | 1, | 506 | 1, |
| 496 | )?; | 507 | )?; |
| 497 | p.expect_end_with_whitespace()?; | 508 | expect_prompt_to_set_origin(&mut p)?; |
| 509 | p.expect_end_eventually()?; | ||
| 498 | for p in [51, 52, 53, 55, 56, 57] { | 510 | for p in [51, 52, 53, 55, 56, 57] { |
| 499 | relay::shutdown_relay(8000 + p)?; | 511 | relay::shutdown_relay(8000 + p)?; |
| 500 | } | 512 | } |