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

Function test_disable_roundtrip

atomic-cli/src/commands/agent/disable.rs:377–401  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

375
376 #[test]
377 fn test_disable_roundtrip() {
378 let dir = tempfile::TempDir::new().unwrap();
379 std::fs::create_dir_all(dir.path().join(".atomic")).unwrap();
380 std::fs::create_dir_all(dir.path().join(".claude")).unwrap();
381
382 let registry = AgentRegistry::with_defaults();
383 let agent = registry.get("claude-code").unwrap();
384
385 // Install hooks first
386 let count = agent.install(dir.path()).unwrap();
387 assert_eq!(count, 8);
388 assert!(agent.is_installed(dir.path()));
389
390 // Uninstall
391 agent.uninstall(dir.path()).unwrap();
392 assert!(!agent.is_installed(dir.path()));
393
394 // Settings file should still exist (with non-Atomic content or empty hooks)
395 let settings_path = dir.path().join(".claude").join("settings.json");
396 assert!(settings_path.exists());
397
398 // Verify no Atomic hooks remain
399 let content = std::fs::read_to_string(&settings_path).unwrap();
400 assert!(!content.contains("atomic agent hooks"));
401 }
402
403 #[test]
404 fn test_disable_preserves_non_atomic_hooks() {

Callers

nothing calls this directly

Calls 5

getMethod · 0.65
unwrapMethod · 0.45
pathMethod · 0.45
installMethod · 0.45
uninstallMethod · 0.45

Tested by

no test coverage detected