Skip to content

Commit

Permalink
chore: Update predicates
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jul 3, 2021
1 parent 6173901 commit 68cf663
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ maintenance = { status = "passively-maintained" }
name = "bin_fixture"

[dependencies]
predicates = { version = "1.0", default-features = false, features = ["difference"] }
predicates = { version = "2.0", default-features = false, features = ["diff"] }
predicates-core = "1.0"
predicates-tree = "1.0"
doc-comment = "0.3"
Expand Down
12 changes: 6 additions & 6 deletions src/assert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ impl Assert {
/// .env("stdout", "hello")
/// .env("stderr", "world")
/// .assert()
/// .stdout(predicate::str::similar("hello\n"));
/// .stdout(predicate::str::diff("hello\n"));
/// ```
///
/// Accepting bytes:
Expand Down Expand Up @@ -379,7 +379,7 @@ impl Assert {
/// .env("stdout", "hello")
/// .env("stderr", "world")
/// .assert()
/// .stderr(predicate::str::similar("world\n"));
/// .stderr(predicate::str::diff("world\n"));
/// ```
///
/// Accepting bytes:
Expand Down Expand Up @@ -654,7 +654,7 @@ impl IntoCodePredicate<InCodePredicate> for &'static [i32] {
/// .env("stdout", "hello")
/// .env("stderr", "world")
/// .assert()
/// .stdout(predicate::str::similar("hello\n").from_utf8());
/// .stdout(predicate::str::diff("hello\n").from_utf8());
///
/// // which can be shortened to:
/// Command::cargo_bin("bin_fixture")
Expand Down Expand Up @@ -785,12 +785,12 @@ pub struct StrContentOutputPredicate(

impl StrContentOutputPredicate {
pub(crate) fn from_str(value: &'static str) -> Self {
let pred = predicates::str::similar(value).from_utf8();
let pred = predicates::str::diff(value).from_utf8();
StrContentOutputPredicate(pred)
}

pub(crate) fn from_string(value: String) -> Self {
let pred = predicates::str::similar(value).from_utf8();
let pred = predicates::str::diff(value).from_utf8();
StrContentOutputPredicate(pred)
}
}
Expand Down Expand Up @@ -863,7 +863,7 @@ impl IntoOutputPredicate<StrContentOutputPredicate> for &'static str {
/// .env("stdout", "hello")
/// .env("stderr", "world")
/// .assert()
/// .stderr(predicate::str::similar("world\n"));
/// .stderr(predicate::str::diff("world\n"));
/// ```
#[derive(Debug, Clone)]
pub struct StrOutputPredicate<P: predicates_core::Predicate<str>>(
Expand Down
4 changes: 2 additions & 2 deletions tests/assert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fn stdout_example() {
.env("stdout", "hello")
.env("stderr", "world")
.assert()
.stdout(predicate::str::similar("hello\n"));
.stdout(predicate::str::diff("hello\n"));

Command::cargo_bin("bin_fixture")
.unwrap()
Expand Down Expand Up @@ -131,7 +131,7 @@ fn stderr_example() {
.env("stdout", "hello")
.env("stderr", "world")
.assert()
.stderr(predicate::str::similar("world\n"));
.stderr(predicate::str::diff("world\n"));

Command::cargo_bin("bin_fixture")
.unwrap()
Expand Down

0 comments on commit 68cf663

Please sign in to comment.