(tmp: &std::path::Path, f: F)
| 160 | use temp_env::with_vars; |
| 161 | |
| 162 | fn with_isolated_cli_env<F: FnOnce()>(tmp: &std::path::Path, f: F) { |
| 163 | let _guard = TEST_ENV_LOCK |
| 164 | .lock() |
| 165 | .unwrap_or_else(std::sync::PoisonError::into_inner); |
| 166 | let tmp = tmp.to_string_lossy().into_owned(); |
| 167 | with_vars( |
| 168 | [ |
| 169 | ("XDG_CONFIG_HOME", Some(tmp.as_str())), |
| 170 | ("OPENSHELL_GATEWAY", None::<&str>), |
| 171 | ], |
| 172 | f, |
| 173 | ); |
| 174 | } |
| 175 | |
| 176 | #[test] |
| 177 | fn gateway_completer_returns_empty_when_no_config() { |