()
| 1586 | |
| 1587 | #[tokio::test] |
| 1588 | async fn test_edit_requires_interactive_terminal() { |
| 1589 | use crate::test_utils::TestGitRepository; |
| 1590 | |
| 1591 | let test_repo = TestGitRepository::new().unwrap(); |
| 1592 | test_repo.init_with_main_branch().unwrap(); |
| 1593 | let repo_path = test_repo.path().to_path_buf(); |
| 1594 | |
| 1595 | let ctx = AppContext::builder().with_interactive(false).build(); |
| 1596 | |
| 1597 | let result = TaskBuilder::new() |
| 1598 | .repo_root(repo_path) |
| 1599 | .name("edit-test".to_string()) |
| 1600 | .task_type("generic".to_string()) |
| 1601 | .edit(true) |
| 1602 | .build(&ctx) |
| 1603 | .await; |
| 1604 | |
| 1605 | assert!( |
| 1606 | result.is_err(), |
| 1607 | "--edit should fail in non-interactive mode" |
| 1608 | ); |
| 1609 | let err_msg = result.unwrap_err().to_string(); |
| 1610 | assert!( |
| 1611 | err_msg.contains("interactive terminal"), |
| 1612 | "Error should mention interactive terminal, got: {err_msg}" |
| 1613 | ); |
| 1614 | } |
| 1615 | |
| 1616 | #[tokio::test] |
| 1617 | async fn test_task_builder_with_branch() { |
nothing calls this directly
no test coverage detected