summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2020-03-07 00:01:35 +0100
committerDavid Peter <sharkdp@users.noreply.github.com>2020-03-09 21:30:46 +0100
commitb1183f72a5d31777a1865f6411b33e73c7f7e1cc (patch)
tree2491de951df4bf777ca68c9a93091d4526312c48 /tests
parenta5e98146fbe4025d9a8461795ee6e2e2560e4695 (diff)
Update to new assert_cmd
Diffstat (limited to 'tests')
-rw-r--r--tests/integration_tests.rs25
1 files changed, 4 insertions, 21 deletions
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs
index fcb5b7c7..0d5f4a3c 100644
--- a/tests/integration_tests.rs
+++ b/tests/integration_tests.rs
@@ -1,22 +1,7 @@
-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();
-}
+use assert_cmd::Command;
fn bat_with_config() -> Command {
- let mut cmd = CARGO_RUN.command();
+ let mut cmd = Command::cargo_bin("bat").unwrap();
cmd.current_dir("tests/examples");
cmd.env_remove("PAGER");
cmd.env_remove("BAT_PAGER");
@@ -46,8 +31,7 @@ fn basic() {
#[test]
fn stdin() {
bat()
- .with_stdin()
- .buffer("foo\nbar\n")
+ .write_stdin("foo\nbar\n")
.assert()
.success()
.stdout("foo\nbar\n");
@@ -69,8 +53,7 @@ fn concatenate_stdin() {
.arg("test.txt")
.arg("-")
.arg("test.txt")
- .with_stdin()
- .buffer("stdin\n")
+ .write_stdin("stdin\n")
.assert()
.success()
.stdout("hello world\nstdin\nhello world\n");