pub struct Expectation<T> { /* private fields */ }Expand description
Wrapper for making assertions.
Implementations§
Source§impl<T> Expectation<T>
impl<T> Expectation<T>
Source§impl<T: PartialEq + Debug> Expectation<T>
impl<T: PartialEq + Debug> Expectation<T>
Source§impl<T: PartialOrd + Debug> Expectation<T>
impl<T: PartialOrd + Debug> Expectation<T>
Sourcepub fn to_be_greater_than(self, other: T)
pub fn to_be_greater_than(self, other: T)
Assert greater than.
Sourcepub fn to_be_less_than(self, other: T)
pub fn to_be_less_than(self, other: T)
Assert less than.
Source§impl Expectation<bool>
impl Expectation<bool>
Sourcepub fn to_be_true(self)
pub fn to_be_true(self)
Assert true.
Sourcepub fn to_be_false(self)
pub fn to_be_false(self)
Assert false.
Source§impl<T> Expectation<Option<T>>
impl<T> Expectation<Option<T>>
Sourcepub fn to_be_some(self)
pub fn to_be_some(self)
Assert Some.
Sourcepub fn to_be_none(self)
pub fn to_be_none(self)
Assert None.
Source§impl<T, E> Expectation<Result<T, E>>
impl<T, E> Expectation<Result<T, E>>
Source§impl<T> Expectation<Vec<T>>
impl<T> Expectation<Vec<T>>
Sourcepub fn to_be_empty(self)
pub fn to_be_empty(self)
Assert empty.
Sourcepub fn to_have_length(self, expected: usize)
pub fn to_have_length(self, expected: usize)
Assert length.
Source§impl Expectation<&str>
impl Expectation<&str>
Sourcepub fn to_contain(self, needle: &str)
pub fn to_contain(self, needle: &str)
Assert contains.
Sourcepub fn to_start_with(self, prefix: &str)
pub fn to_start_with(self, prefix: &str)
Assert starts with.
Sourcepub fn to_end_with(self, suffix: &str)
pub fn to_end_with(self, suffix: &str)
Assert ends with.
Source§impl Expectation<String>
impl Expectation<String>
Sourcepub fn to_contain(self, needle: &str)
pub fn to_contain(self, needle: &str)
Assert contains.
Sourcepub fn to_be_empty(self)
pub fn to_be_empty(self)
Assert empty.
Source§impl Expectation<f32>
impl Expectation<f32>
Sourcepub fn to_be_close_to(self, expected: f32, epsilon: f32)
pub fn to_be_close_to(self, expected: f32, epsilon: f32)
Assert close to (within epsilon).
Source§impl Expectation<f64>
impl Expectation<f64>
Sourcepub fn to_be_close_to(self, expected: f64, epsilon: f64)
pub fn to_be_close_to(self, expected: f64, epsilon: f64)
Assert close to (within epsilon).