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:536–559  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

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