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

Function installs_into_empty_target

atomic-agent/src/hooks/manifest.rs:405–422  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

403
404 #[test]
405 fn installs_into_empty_target() {
406 let dir = tempfile::tempdir().unwrap();
407 let target = dir.path().join("hooks.json");
408 let manifest = dir.path().join("manifest.json");
409 write(
410 &manifest,
411 &manifest_json(&target, "atomic agent hooks codex"),
412 );
413
414 let outcome = install_from_manifest(&manifest).unwrap();
415 assert_eq!(outcome.added, 2);
416 assert_eq!(outcome.removed, 0);
417
418 let written: Value =
419 serde_json::from_str(&std::fs::read_to_string(&target).unwrap()).unwrap();
420 assert!(written["hooks"]["SessionStart"].is_array());
421 assert!(written["hooks"]["Stop"].is_array());
422 }
423
424 #[test]
425 fn is_idempotent_and_syncs_changes() {

Callers

nothing calls this directly

Calls 5

writeFunction · 0.85
manifest_jsonFunction · 0.85
install_from_manifestFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected