Macro fluent_asserter::assert_that_code
source · [−]macro_rules! assert_that_code {
($value:expr) => { ... };
}
Expand description
Creating fluent assertion to check if a closure panics
NOTE: Do not use this and the native #[should_panic] attribute at the same time while executing the tests parallel, as it can have non-deterministic behaviour
Examples
assert_that_code!(|| panic!("An error occurred!"))
.panics()
.with_message("An error occurred!");
assert_that_code!(|| println!("Life tastes great!"))
.does_not_panic();