| 1042 | |
| 1043 | #[test] |
| 1044 | fn test_detect_presence_file_not_dir() { |
| 1045 | let tmp = TempDir::new().unwrap(); |
| 1046 | std::fs::write(tmp.path().join(".opencode"), "not a dir").unwrap(); |
| 1047 | let hook = make_hook(); |
| 1048 | // A regular file named .opencode is not a directory, so repo-local |
| 1049 | // detection fails. Overall result depends on global plugin state. |
| 1050 | if !OpenCodeHook::is_plugin_installed() { |
| 1051 | assert!(!hook.detect_presence(tmp.path())); |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | #[test] |
| 1056 | fn test_install_returns_count_based_on_plugin() { |