(current_dir: P, arguments: I)
| 214 | } |
| 215 | |
| 216 | pub fn run_test_bin<I, T, P: AsRef<Path>>(current_dir: P, arguments: I) -> Output |
| 217 | where |
| 218 | I: IntoIterator<Item = T>, |
| 219 | T: AsRef<OsStr>, |
| 220 | { |
| 221 | let mut current_dir_buf: PathBuf = current_dir.as_ref().into(); |
| 222 | if current_dir_buf.is_relative() { |
| 223 | current_dir_buf = current_dir_buf.canonicalize().unwrap(); |
| 224 | } |
| 225 | |
| 226 | assert_cmd::Command::cargo_bin(env!("CARGO_PKG_NAME")) |
| 227 | .expect("Failed to get git-chain") |
| 228 | .current_dir(current_dir_buf) |
| 229 | .args(arguments) |
| 230 | .output() |
| 231 | .expect("Failed to run git-chain") |
| 232 | } |
| 233 | |
| 234 | pub fn run_test_bin_with_env<I, T, E, K, V, P: AsRef<Path>>( |
| 235 | current_dir: P, |
no outgoing calls