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

Function installs_into_empty_target

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

Source from the content-addressed store, hash-verified

365
366 #[test]
367 fn installs_into_empty_target() {
368 let dir = tempfile::tempdir().unwrap();
369 let target = dir.path().join("hooks.json");
370 let manifest = dir.path().join("manifest.json");
371 write(
372 &manifest,
373 &manifest_json(&target, "atomic agent hooks codex"),
374 );
375
376 let outcome = install_from_manifest(&manifest).unwrap();
377 assert_eq!(outcome.added, 2);
378 assert_eq!(outcome.removed, 0);
379
380 let written: Value =
381 serde_json::from_str(&std::fs::read_to_string(&target).unwrap()).unwrap();
382 assert!(written["hooks"]["SessionStart"].is_array());
383 assert!(written["hooks"]["Stop"].is_array());
384 }
385
386 #[test]
387 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