Struct spectral::AssertionFailure
[−]
[src]
pub struct AssertionFailure<'r, T: 'r> { /* fields omitted */ }
A failed assertion.
This exposes builder methods to construct the final failure message.
Methods
impl<'r, T: DescriptiveSpec<'r>> AssertionFailure<'r, T>
[src]
fn from_spec(spec: &'r T) -> AssertionFailure<'r, T>
Construct a new AssertionFailure from a DescriptiveSpec.
fn with_expected(&mut self, expected: String) -> &mut Self
Builder method to add the expected value for the panic message.
fn with_actual(&mut self, actual: String) -> &mut Self
Builder method to add the actual value for the panic message.
fn fail(&mut self)
Builds the failure message with a description (if present), the expected value,
and the actual value and then calls panic
with the created message.