diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/send.rs | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/tests/send.rs b/tests/send.rs index 58c21f9..06f1b86 100644 --- a/tests/send.rs +++ b/tests/send.rs | |||
| @@ -4,29 +4,11 @@ use serial_test::serial; | |||
| 4 | use test_utils::{git::GitTestRepo, relay::Relay, *}; | 4 | use test_utils::{git::GitTestRepo, relay::Relay, *}; |
| 5 | 5 | ||
| 6 | #[test] | 6 | #[test] |
| 7 | fn when_to_branch_doesnt_exist_return_error() -> Result<()> { | 7 | fn when_no_main_or_master_branch_return_error() -> Result<()> { |
| 8 | let test_repo = GitTestRepo::default(); | ||
| 9 | test_repo.populate()?; | ||
| 10 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["send", "--to-branch", "nonexistant"]); | ||
| 11 | p.expect("Error: cannot find to_branch 'nonexistant'")?; | ||
| 12 | Ok(()) | ||
| 13 | } | ||
| 14 | |||
| 15 | #[test] | ||
| 16 | fn when_no_to_branch_specified_and_no_main_or_master_branch_return_error() -> Result<()> { | ||
| 17 | let test_repo = GitTestRepo::new("notmain")?; | 8 | let test_repo = GitTestRepo::new("notmain")?; |
| 18 | test_repo.populate()?; | 9 | test_repo.populate()?; |
| 19 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["send"]); | 10 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["send"]); |
| 20 | p.expect("Error: a destination branch (to_branch) is not specified and the defaults (main or master) do not exist")?; | 11 | p.expect("Error: the default branches (main or master) do not exist")?; |
| 21 | Ok(()) | ||
| 22 | } | ||
| 23 | |||
| 24 | #[test] | ||
| 25 | fn when_from_branch_doesnt_exist_return_error() -> Result<()> { | ||
| 26 | let test_repo = GitTestRepo::default(); | ||
| 27 | test_repo.populate()?; | ||
| 28 | let mut p = CliTester::new_from_dir(&test_repo.dir, ["send", "--from-branch", "nonexistant"]); | ||
| 29 | p.expect("Error: cannot find from_branch 'nonexistant'")?; | ||
| 30 | Ok(()) | 12 | Ok(()) |
| 31 | } | 13 | } |
| 32 | 14 | ||