mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
tests: Update assert_cmd
Use new cargo_bin_cmd macro. Old way of building Commands is deprecated
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use assert_cmd::Command;
|
||||
use assert_cmd::{Command, cargo_bin_cmd};
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
@@ -44,7 +44,7 @@ pub fn test_soft_sym_link() {
|
||||
let b = format!(" ┌── {}", file_path_s);
|
||||
let a = format!("─┴ {}", dir_s);
|
||||
|
||||
let mut cmd = Command::cargo_bin("dust").unwrap();
|
||||
let mut cmd = cargo_bin_cmd!("dust");
|
||||
// Mac test runners create long filenames in tmp directories
|
||||
let output = cmd
|
||||
.args(["-p", "-c", "-s", "-w", "999", dir_s])
|
||||
@@ -72,7 +72,7 @@ pub fn test_hard_sym_link() {
|
||||
let file_output = format!(" ┌── {}", file_path_s);
|
||||
let dirs_output = format!("─┴ {}", dir_s);
|
||||
|
||||
let mut cmd = Command::cargo_bin("dust").unwrap();
|
||||
let mut cmd = cargo_bin_cmd!("dust");
|
||||
// Mac test runners create long filenames in tmp directories
|
||||
let output = cmd.args(["-p", "-c", "-w", "999", dir_s]).unwrap().stdout;
|
||||
|
||||
@@ -96,7 +96,7 @@ pub fn test_hard_sym_link_no_dup_multi_arg() {
|
||||
let link_name = dir_link.path().join("the_link");
|
||||
let link_name_s = link_it(link_name, file_path_s, false);
|
||||
|
||||
let mut cmd = Command::cargo_bin("dust").unwrap();
|
||||
let mut cmd = cargo_bin_cmd!("dust");
|
||||
|
||||
// Mac test runners create long filenames in tmp directories
|
||||
let output = cmd
|
||||
@@ -123,7 +123,7 @@ pub fn test_recursive_sym_link() {
|
||||
let a = format!("─┬ {}", dir_s);
|
||||
let b = format!(" └── {}", link_name_s);
|
||||
|
||||
let mut cmd = Command::cargo_bin("dust").unwrap();
|
||||
let mut cmd = cargo_bin_cmd!("dust");
|
||||
let output = cmd
|
||||
.arg("-p")
|
||||
.arg("-c")
|
||||
|
||||
Reference in New Issue
Block a user