Skip to content

Commit 6fbee65

Browse files
committed
chore(pact_ffi): Fix flaky test
1 parent 2767ac6 commit 6fbee65

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

rust/pact_ffi/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ zeroize = "1.8.1"
5858

5959
[dev-dependencies]
6060
expectest = "0.12.0"
61+
hamcrest2 = "0.3.0"
6162
home = "0.5.9"
6263
pretty_assertions = "1.4.0"
6364
quickcheck = "1.0.3"

rust/pact_ffi/src/verifier/handle.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ impl Default for VerifierHandle {
346346
#[cfg(test)]
347347
mod tests {
348348
use expectest::prelude::*;
349+
use hamcrest2::prelude::*;
349350
use serde_json::Value;
350351

351352
use pact_models::pact::Pact;
@@ -377,6 +378,6 @@ mod tests {
377378
expect!(handle.verifier_output.result).to(be_false());
378379
let error: Value = handle.verifier_output.errors[0].clone().1.into();
379380
let message = error.as_object().unwrap()["message"].as_str().unwrap();
380-
expect!(message).to(be_equal_to("error sending request"));
381+
assert_that!(message, matches_regex(r"^error sending request"));
381382
}
382383
}

0 commit comments

Comments
 (0)