diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 21:38:24 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 22:12:07 +0000 |
| commit | b1dc1fc39dcb01a850df7e31bb9438a195cf101e (patch) | |
| tree | 3c545d5153e0936f71f78a2ded235d8096077343 | |
| parent | f6d1e03dc99b3ea48cb6e4bd1d3371dd924a567a (diff) | |
fix(tests): update send tests to use --subject instead of --title
The send subcommand was updated to use --subject (with --title as an
alias) but the non_interactive_validation tests still checked for
--title in error messages and used --title as the CLI argument.
| -rw-r--r-- | tests/ngit_send.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/ngit_send.rs b/tests/ngit_send.rs index 9e66051..814c06c 100644 --- a/tests/ngit_send.rs +++ b/tests/ngit_send.rs | |||
| @@ -2038,7 +2038,7 @@ mod non_interactive_validation { | |||
| 2038 | let output = p.expect_end_eventually()?; | 2038 | let output = p.expect_end_eventually()?; |
| 2039 | assert!(output.contains("ngit send requires additional arguments")); | 2039 | assert!(output.contains("ngit send requires additional arguments")); |
| 2040 | assert!(output.contains("<SINCE_OR_RANGE>")); | 2040 | assert!(output.contains("<SINCE_OR_RANGE>")); |
| 2041 | assert!(output.contains("--title")); | 2041 | assert!(output.contains("--subject")); |
| 2042 | assert!(output.contains("--description")); | 2042 | assert!(output.contains("--description")); |
| 2043 | assert!(output.contains("--defaults")); | 2043 | assert!(output.contains("--defaults")); |
| 2044 | assert!(output.contains("--interactive")); | 2044 | assert!(output.contains("--interactive")); |
| @@ -2051,7 +2051,7 @@ mod non_interactive_validation { | |||
| 2051 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["send", "HEAD~2"]); | 2051 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["send", "HEAD~2"]); |
| 2052 | let output = p.expect_end_eventually()?; | 2052 | let output = p.expect_end_eventually()?; |
| 2053 | assert!(output.contains("ngit send requires additional arguments")); | 2053 | assert!(output.contains("ngit send requires additional arguments")); |
| 2054 | assert!(output.contains("--title")); | 2054 | assert!(output.contains("--subject")); |
| 2055 | assert!(output.contains("--description")); | 2055 | assert!(output.contains("--description")); |
| 2056 | assert!(output.contains("--defaults")); | 2056 | assert!(output.contains("--defaults")); |
| 2057 | Ok(()) | 2057 | Ok(()) |
| @@ -2063,7 +2063,7 @@ mod non_interactive_validation { | |||
| 2063 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["send", "--force-pr", "HEAD~2"]); | 2063 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["send", "--force-pr", "HEAD~2"]); |
| 2064 | let output = p.expect_end_eventually()?; | 2064 | let output = p.expect_end_eventually()?; |
| 2065 | assert!(output.contains("ngit send requires additional arguments")); | 2065 | assert!(output.contains("ngit send requires additional arguments")); |
| 2066 | assert!(output.contains("--title")); | 2066 | assert!(output.contains("--subject")); |
| 2067 | assert!(output.contains("--description")); | 2067 | assert!(output.contains("--description")); |
| 2068 | assert!(output.contains("--defaults")); | 2068 | assert!(output.contains("--defaults")); |
| 2069 | Ok(()) | 2069 | Ok(()) |
| @@ -2075,17 +2075,17 @@ mod non_interactive_validation { | |||
| 2075 | let mut p = | 2075 | let mut p = |
| 2076 | CliTester::new_from_dir(&test_repo.dir, ["send", "--description", "Y", "HEAD~2"]); | 2076 | CliTester::new_from_dir(&test_repo.dir, ["send", "--description", "Y", "HEAD~2"]); |
| 2077 | let output = p.expect_end_eventually()?; | 2077 | let output = p.expect_end_eventually()?; |
| 2078 | assert!(output.contains("ngit send requires --title when --description is provided")); | 2078 | assert!(output.contains("ngit send requires --subject when --description is provided")); |
| 2079 | assert!(output.contains("--title")); | 2079 | assert!(output.contains("--subject")); |
| 2080 | Ok(()) | 2080 | Ok(()) |
| 2081 | } | 2081 | } |
| 2082 | 2082 | ||
| 2083 | #[test] | 2083 | #[test] |
| 2084 | fn send_title_without_description_errors() -> Result<()> { | 2084 | fn send_title_without_description_errors() -> Result<()> { |
| 2085 | let test_repo = prep_git_repo()?; | 2085 | let test_repo = prep_git_repo()?; |
| 2086 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["send", "--title", "X", "HEAD~2"]); | 2086 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["send", "--subject", "X", "HEAD~2"]); |
| 2087 | let output = p.expect_end_eventually()?; | 2087 | let output = p.expect_end_eventually()?; |
| 2088 | assert!(output.contains("ngit send requires --description when --title is provided")); | 2088 | assert!(output.contains("ngit send requires --description when --subject is provided")); |
| 2089 | assert!(output.contains("--description")); | 2089 | assert!(output.contains("--description")); |
| 2090 | Ok(()) | 2090 | Ok(()) |
| 2091 | } | 2091 | } |