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

Function test_disable_roundtrip

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

Source from the content-addressed store, hash-verified

450
451 #[test]
452 fn test_disable_roundtrip() {
453 let dir = tempfile::TempDir::new().unwrap();
454 std::fs::create_dir_all(dir.path().join(".atomic")).unwrap();
455 std::fs::create_dir_all(dir.path().join(".claude")).unwrap();
456
457 let registry = AgentRegistry::with_defaults();
458 let agent = registry.get("claude-code").unwrap();
459
460 // Install hooks first
461 let count = agent.install(dir.path()).unwrap();
462 assert_eq!(count, 8);
463 assert!(agent.is_installed(dir.path()));
464
465 // Uninstall
466 agent.uninstall(dir.path()).unwrap();
467 assert!(!agent.is_installed(dir.path()));
468
469 // Settings file should still exist (with non-Atomic content or empty hooks)
470 let settings_path = dir.path().join(".claude").join("settings.json");
471 assert!(settings_path.exists());
472
473 // Verify no Atomic hooks remain
474 let content = std::fs::read_to_string(&settings_path).unwrap();
475 assert!(!content.contains("atomic agent hooks"));
476 }
477
478 #[test]
479 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