From 701668b02d999af42f51d8bd25fffb2a8692c3c8 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 16 Feb 2024 22:31:29 +0000 Subject: refactor: rename PR to proposal PR is a problematic term when it ambiguous whether the set of patches are PR-like or email-patch like. --- tests/push.rs | 62 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'tests/push.rs') diff --git a/tests/push.rs b/tests/push.rs index 07148ae..6f3a593 100644 --- a/tests/push.rs +++ b/tests/push.rs @@ -7,33 +7,33 @@ static FEATURE_BRANCH_NAME_1: &str = "feature-example-t"; static FEATURE_BRANCH_NAME_2: &str = "feature-example-f"; static FEATURE_BRANCH_NAME_3: &str = "feature-example-c"; -static PR_TITLE_1: &str = "pr a"; -static PR_TITLE_2: &str = "pr b"; -static PR_TITLE_3: &str = "pr c"; +static PROPOSAL_TITLE_1: &str = "proposal a"; +static PROPOSAL_TITLE_2: &str = "proposal b"; +static PROPOSAL_TITLE_3: &str = "proposal c"; -fn cli_tester_create_prs() -> Result { +fn cli_tester_create_proposals() -> Result { let git_repo = GitTestRepo::default(); git_repo.populate()?; - cli_tester_create_pr( + cli_tester_create_proposal( &git_repo, FEATURE_BRANCH_NAME_1, "a", - PR_TITLE_1, - "pr a description", + PROPOSAL_TITLE_1, + "proposal a description", )?; - cli_tester_create_pr( + cli_tester_create_proposal( &git_repo, FEATURE_BRANCH_NAME_2, "b", - PR_TITLE_2, - "pr b description", + PROPOSAL_TITLE_2, + "proposal b description", )?; - cli_tester_create_pr( + cli_tester_create_proposal( &git_repo, FEATURE_BRANCH_NAME_3, "c", - PR_TITLE_3, - "pr c description", + PROPOSAL_TITLE_3, + "proposal c description", )?; Ok(git_repo) } @@ -62,7 +62,7 @@ fn create_and_populate_branch( Ok(()) } -fn cli_tester_create_pr( +fn cli_tester_create_proposal( test_repo: &GitTestRepo, branch_name: &str, prefix: &str, @@ -100,13 +100,13 @@ mod when_main_is_checked_out { create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", false)?; test_repo.checkout("main")?; let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); - p.expect("Error: checkout a branch associated with a PR first\r\n")?; + p.expect("Error: checkout a branch associated with a proposal first\r\n")?; p.expect_end()?; Ok(()) } } -mod when_pr_isnt_associated_with_branch_name { +mod when_proposal_isnt_associated_with_branch_name { use super::*; mod cli_prompts { @@ -130,7 +130,7 @@ mod when_pr_isnt_associated_with_branch_name { r55.events.push(generate_test_key_1_relay_list_event()); let cli_tester_handle = std::thread::spawn(move || -> Result<()> { - cli_tester_create_prs()?; + cli_tester_create_proposals()?; let test_repo = GitTestRepo::default(); test_repo.populate()?; @@ -139,9 +139,9 @@ mod when_pr_isnt_associated_with_branch_name { test_repo.checkout("random-name")?; let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); - p.expect("finding PR event...\r\n")?; + p.expect("finding proposal root event...\r\n")?; p.expect( - "Error: cannot find a PR event associated with the checked out branch name\r\n", + "Error: cannot find a proposal root event associated with the checked out branch name\r\n", )?; p.expect_end()?; @@ -198,7 +198,7 @@ mod when_branch_is_checked_out { r55.events.push(generate_test_key_1_relay_list_event()); let cli_tester_handle = std::thread::spawn(move || -> Result<()> { - cli_tester_create_prs()?; + cli_tester_create_proposals()?; let test_repo = GitTestRepo::default(); test_repo.populate()?; @@ -206,9 +206,9 @@ mod when_branch_is_checked_out { create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", false)?; let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); - p.expect("finding PR event...\r\n")?; - p.expect("found PR event. finding commits...\r\n")?; - p.expect("Error: nostr pr already up-to-date with local branch\r\n")?; + p.expect("finding proposal root event...\r\n")?; + p.expect("found proposal root event. finding commits...\r\n")?; + p.expect("Error: nostr proposal already up-to-date with local branch\r\n")?; p.expect_end()?; for p in [51, 52, 53, 55, 56] { @@ -261,7 +261,7 @@ mod when_branch_is_checked_out { r55.events.push(generate_test_key_1_relay_list_event()); let cli_tester_handle = std::thread::spawn(move || -> Result<()> { - cli_tester_create_prs()?; + cli_tester_create_proposals()?; let test_repo = GitTestRepo::default(); test_repo.populate()?; @@ -269,9 +269,9 @@ mod when_branch_is_checked_out { create_and_populate_branch(&test_repo, FEATURE_BRANCH_NAME_1, "a", true)?; let mut p = CliTester::new_from_dir(&test_repo.dir, ["push"]); - p.expect("finding PR event...\r\n")?; - p.expect("found PR event. finding commits...\r\n")?; - p.expect("Error: nostr pr is ahead of local branch\r\n")?; + p.expect("finding proposal root event...\r\n")?; + p.expect("found proposal root event. finding commits...\r\n")?; + p.expect("Error: nostr proposal is ahead of local branch\r\n")?; p.expect_end()?; for p in [51, 52, 53, 55, 56] { @@ -329,7 +329,7 @@ mod when_branch_is_checked_out { let cli_tester_handle = std::thread::spawn(move || -> Result<(GitTestRepo, GitTestRepo)> { - let originating_repo = cli_tester_create_prs()?; + let originating_repo = cli_tester_create_proposals()?; let test_repo = GitTestRepo::default(); test_repo.populate()?; @@ -350,8 +350,8 @@ mod when_branch_is_checked_out { "push", ], ); - p.expect("finding PR event...\r\n")?; - p.expect("found PR event. finding commits...\r\n")?; + p.expect("finding proposal root event...\r\n")?; + p.expect("found proposal root event. finding commits...\r\n")?; p.expect( "1 commits ahead. preparing to create creating patch events.\r\n", )?; @@ -420,7 +420,7 @@ mod when_branch_is_checked_out { r55.events.push(generate_test_key_1_relay_list_event()); let cli_tester_handle = std::thread::spawn(move || -> Result { - cli_tester_create_prs()?; + cli_tester_create_proposals()?; let test_repo = GitTestRepo::default(); test_repo.populate()?; -- cgit v1.2.3