diff --git a/Cargo.lock b/Cargo.lock index 04687ac7..948706ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,6 +66,7 @@ dependencies = [ "directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "escargot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "git2 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index bd6dbc0a..b901d320 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,7 @@ features = [] [dev-dependencies] tempdir = "0.3" assert_cmd = "0.10.1" +escargot = "0.3.1" [build-dependencies] clap = "2.32" diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index c30c2cac..3102cb13 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,10 +1,22 @@ extern crate assert_cmd; +extern crate escargot; +#[macro_use] +extern crate lazy_static; use assert_cmd::prelude::*; +use escargot::CargoRun; use std::process::Command; +lazy_static! { + static ref CARGO_RUN: CargoRun = escargot::CargoBuild::new() + .bin("bat") + .current_release() + .run() + .unwrap(); +} + fn bat_with_config() -> Command { - let mut cmd = Command::main_binary().unwrap(); + let mut cmd = CARGO_RUN.command(); cmd.current_dir("tests/examples"); cmd.env_remove("PAGER"); cmd.env_remove("BAT_PAGER");