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

Function test_disable_roundtrip

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

Source from the content-addressed store, hash-verified

348
349 #[test]
350 fn test_disable_roundtrip() {
351 let dir = tempfile::TempDir::new().unwrap();
352 std::fs::create_dir_all(dir.path().join(".atomic")).unwrap();
353 std::fs::create_dir_all(dir.path().join(".claude")).unwrap();
354
355 let registry = AgentRegistry::with_defaults();
356 let agent = registry.get("claude-code").unwrap();
357
358 // Install hooks first
359 let count = agent.install(dir.path()).unwrap();
360 assert_eq!(count, 8);
361 assert!(agent.is_installed(dir.path()));
362
363 // Uninstall
364 agent.uninstall(dir.path()).unwrap();
365 assert!(!agent.is_installed(dir.path()));
366
367 // Settings file should still exist (with non-Atomic content or empty hooks)
368 let settings_path = dir.path().join(".claude").join("settings.json");
369 assert!(settings_path.exists());
370
371 // Verify no Atomic hooks remain
372 let content = std::fs::read_to_string(&settings_path).unwrap();
373 assert!(!content.contains("atomic agent hooks"));
374 }
375
376 #[test]
377 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