()
| 638 | |
| 639 | #[test] |
| 640 | fn test_install_idempotent() { |
| 641 | let dir = tempfile::tempdir().unwrap(); |
| 642 | let hook = make_hook(); |
| 643 | |
| 644 | let count1 = hook.install(dir.path()).unwrap(); |
| 645 | assert_eq!(count1, 8); |
| 646 | |
| 647 | // Second install should return 0 (nothing new to install) |
| 648 | let count2 = hook.install(dir.path()).unwrap(); |
| 649 | assert_eq!(count2, 0); |
| 650 | } |
| 651 | |
| 652 | #[test] |
| 653 | fn test_install_preserves_existing_hooks() { |