Detailed changes
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,8 +1,8 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,10 +1,10 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use loro::{ExportMode, LoroDoc, VersionVector};
use predicates::prelude::*;
#[test]
fn sync_help_shows_usage() {
- let mut cmd = Command::cargo_bin("td").unwrap();
+ let mut cmd = cargo_bin_cmd!("td");
cmd.args(["sync", "--help"]);
cmd.assert()
.success()
@@ -16,15 +16,14 @@ fn sync_invalid_code_format_fails() {
let home = tempfile::tempdir().unwrap();
let cwd = tempfile::tempdir().unwrap();
- Command::cargo_bin("td")
- .unwrap()
+ cargo_bin_cmd!("td")
.args(["project", "init", "synctest"])
.current_dir(cwd.path())
.env("HOME", home.path())
.assert()
.success();
- let mut cmd = Command::cargo_bin("td").unwrap();
+ let mut cmd = cargo_bin_cmd!("td");
cmd.args(["sync", "not-a-valid-code"])
.current_dir(cwd.path())
.env("HOME", home.path());
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,9 +1,9 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use predicates::prelude::*;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}
@@ -1,8 +1,8 @@
-use assert_cmd::Command;
+use assert_cmd::cargo::cargo_bin_cmd;
use tempfile::TempDir;
-fn td(home: &TempDir) -> Command {
- let mut cmd = Command::cargo_bin("td").unwrap();
+fn td(home: &TempDir) -> assert_cmd::Command {
+ let mut cmd = cargo_bin_cmd!("td");
cmd.env("HOME", home.path());
cmd
}