Assertion macros

Version 0.2.0 Updated Dec 08, 2025

When step functions return Result values it is common to assert on their outcome. The rstest-bdd crate exports two helper macros to streamline these checks:

use rstest_bdd::{assert_step_err, assert_step_ok};

let ok: Result<(), &str> = Ok(());
assert_step_ok!(ok);

let err: Result<(), &str> = Err("boom");
let e = assert_step_err!(err, "boom");
assert_eq!(e, "boom");

assert_step_ok! unwraps an Ok value and panics with the error message when the result is Err. assert_step_err! unwraps the error and optionally checks that its display contains a substring. Both macros return their unwrapped values, allowing further inspection when required.