()
| 467 | |
| 468 | #[test] |
| 469 | fn test_goal_start() { |
| 470 | let dir = tempdir().unwrap(); |
| 471 | let repo = Repository::init(dir.path()).unwrap(); |
| 472 | repo.init_vault().unwrap(); |
| 473 | |
| 474 | let result = repo |
| 475 | .vault_goal_start(GoalStartOptions { |
| 476 | developer: Some("alice".to_string()), |
| 477 | intent: Some("PIMO-1".to_string()), |
| 478 | ..Default::default() |
| 479 | }) |
| 480 | .unwrap(); |
| 481 | |
| 482 | assert!(!result.name.is_empty()); |
| 483 | assert!(result.goal_file.starts_with("goals/")); |
| 484 | assert!(result.goal_file.ends_with("/_goal.md")); |
| 485 | |
| 486 | // Should be in manifest |
| 487 | let manifest = repo.vault_manifest().unwrap(); |
| 488 | assert!(manifest.goals.contains_key(&result.name)); |
| 489 | assert_eq!(manifest.goals[&result.name].status, "active"); |
| 490 | assert_eq!(manifest.goals[&result.name].developer, "alice"); |
| 491 | |
| 492 | // Should be materialized on disk |
| 493 | assert!(repo.vault_dir().join(&result.goal_file).exists()); |
| 494 | } |
| 495 | |
| 496 | #[test] |
| 497 | fn test_goal_start_custom_name() { |
nothing calls this directly
no test coverage detected