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

Function test_disable_roundtrip

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

Source from the content-addressed store, hash-verified

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