()
| 983 | |
| 984 | #[tokio::test] |
| 985 | async fn test_task_builder_repository_copy() { |
| 986 | use crate::test_utils::TestGitRepository; |
| 987 | |
| 988 | let test_repo = TestGitRepository::new().unwrap(); |
| 989 | test_repo.init_with_commit().unwrap(); |
| 990 | |
| 991 | // Add some files to verify they get copied |
| 992 | test_repo |
| 993 | .create_file("src/main.rs", "fn main() {}") |
| 994 | .unwrap(); |
| 995 | test_repo |
| 996 | .create_file("Cargo.toml", "[package]\nname = \"test\"") |
| 997 | .unwrap(); |
| 998 | test_repo.stage_all().unwrap(); |
| 999 | test_repo.commit("Add source files").unwrap(); |
| 1000 | |
| 1001 | let ctx = AppContext::builder().build(); |
| 1002 | |
| 1003 | let task = TaskBuilder::new() |
| 1004 | .repo_root(test_repo.path().to_path_buf()) |
| 1005 | .name("copy-test".to_string()) |
| 1006 | .prompt(Some("Test repository copy".to_string())) |
| 1007 | .build(&ctx) |
| 1008 | .await |
| 1009 | .unwrap(); |
| 1010 | |
| 1011 | // Verify repository was copied to the correct location |
| 1012 | let task_dir = ctx.tsk_env().task_dir(&task.id); |
| 1013 | let copied_repo = task_dir.join("repo"); |
| 1014 | |
| 1015 | assert!(copied_repo.exists()); |
| 1016 | assert!(copied_repo.join("src/main.rs").exists()); |
| 1017 | assert!(copied_repo.join("Cargo.toml").exists()); |
| 1018 | assert!(copied_repo.join(".git").exists()); |
| 1019 | } |
| 1020 | |
| 1021 | #[tokio::test] |
| 1022 | async fn test_task_builder_creates_output_directory() { |
nothing calls this directly
no test coverage detected