MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_goal_start

Function test_goal_start

atomic-repository/src/repository/vault_goal.rs:469–494  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

vault_goal_startMethod · 0.80
vault_manifestMethod · 0.80
unwrapMethod · 0.45
pathMethod · 0.45
init_vaultMethod · 0.45

Tested by

no test coverage detected