MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / test_edit_requires_interactive_terminal

Function test_edit_requires_interactive_terminal

src/task_builder.rs:1588–1614  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 8

init_with_main_branchMethod · 0.80
pathMethod · 0.80
editMethod · 0.80
task_typeMethod · 0.80
repo_rootMethod · 0.80
buildMethod · 0.45
with_interactiveMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected