Skip to main content

assert_error

Function assert_error 

Source
pub fn assert_error<T>(result: Result<T>)
Expand description

Assert that a result is an error (generic error assertion)

This function checks if the result is an error without checking the specific error type. Use specific error assertions (like assert_not_found_error) for type-specific checks.

§Examples

use reinhardt_testkit::assertions::assert_error;
use reinhardt_http::{Error, Result};

let result: Result<()> = Err(Error::NotFound("Item not found".to_string()));
assert_error(result);

§Panics

Panics if result is Ok.