assertables

Module assert_status

Source
Expand description

Assert for comparing status concepts.

These macros help with commands, program, processes, and anything else that provides a method status(), and optionally status methods such as:

  • success() => bool
  • code() => Result(T, E)

Try success/failure:

Compare a status code with another status code:

Compare a status code with an expression:

§Example

use assertables::*;
use std::process::Command;

let mut a = Command::new("bin/exit-with-arg"); a.arg("1");
let mut b = Command::new("bin/exit-with-arg"); b.arg("1");
assert_status_code_value_eq!(a, b);

Modules§