Struct spectral::AssertionFailure
[−]
[src]
pub struct AssertionFailure<'r> { /* fields omitted */ }
A failed assertion.
This exposes builder methods to construct the final failure message.
Methods
impl<'r> AssertionFailure<'r>
[src]
fn from_spec<T: DescriptiveSpec<'r>>(spec: &T) -> AssertionFailure<'r>
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.