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

Function test_enable_force_reinstall

atomic-cli/src/commands/agent/enable.rs:530–553  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

528
529 #[test]
530 fn test_enable_force_reinstall() {
531 let dir = tempfile::TempDir::new().unwrap();
532 std::fs::create_dir_all(dir.path().join(".atomic")).unwrap();
533 std::fs::create_dir_all(dir.path().join(".claude")).unwrap();
534
535 let registry = AgentRegistry::with_defaults();
536 let agent = registry.get("claude-code").unwrap();
537
538 // First install
539 let count1 = agent.install(dir.path()).unwrap();
540 assert_eq!(count1, 8);
541
542 // Second install without force — should be 0
543 let count2 = agent.install(dir.path()).unwrap();
544 assert_eq!(count2, 0);
545
546 // Uninstall and reinstall (simulating --force)
547 agent.uninstall(dir.path()).unwrap();
548 assert!(!agent.is_installed(dir.path()));
549
550 let count3 = agent.install(dir.path()).unwrap();
551 assert_eq!(count3, 8);
552 assert!(agent.is_installed(dir.path()));
553 }
554}

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