mirror of
https://github.com/sharkdp/bat.git
synced 2025-03-14 06:38:24 +00:00
Update to new assert_cmd
This commit is contained in:
parent
a5e98146fb
commit
b1183f72a5
@ -51,7 +51,6 @@ features = []
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempdir = "0.3"
|
tempdir = "0.3"
|
||||||
assert_cmd = "0.12.0"
|
assert_cmd = "0.12.0"
|
||||||
escargot = "0.5.0"
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
clap = "2.33"
|
clap = "2.33"
|
||||||
|
@ -1,22 +1,7 @@
|
|||||||
extern crate assert_cmd;
|
use assert_cmd::Command;
|
||||||
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 {
|
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.current_dir("tests/examples");
|
||||||
cmd.env_remove("PAGER");
|
cmd.env_remove("PAGER");
|
||||||
cmd.env_remove("BAT_PAGER");
|
cmd.env_remove("BAT_PAGER");
|
||||||
@ -46,8 +31,7 @@ fn basic() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn stdin() {
|
fn stdin() {
|
||||||
bat()
|
bat()
|
||||||
.with_stdin()
|
.write_stdin("foo\nbar\n")
|
||||||
.buffer("foo\nbar\n")
|
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stdout("foo\nbar\n");
|
.stdout("foo\nbar\n");
|
||||||
@ -69,8 +53,7 @@ fn concatenate_stdin() {
|
|||||||
.arg("test.txt")
|
.arg("test.txt")
|
||||||
.arg("-")
|
.arg("-")
|
||||||
.arg("test.txt")
|
.arg("test.txt")
|
||||||
.with_stdin()
|
.write_stdin("stdin\n")
|
||||||
.buffer("stdin\n")
|
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stdout("hello world\nstdin\nhello world\n");
|
.stdout("hello world\nstdin\nhello world\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user