[][src]Trait assert4rs::AssertEquals

pub trait AssertEquals<R> {
    pub fn is(self, expected: R) -> Self;
pub fn is_not(self, other: R) -> Self; }

Used to assert equality or inequality of some value with self.

It takes ownership of self and returns ownership back so that assertions can be chained in fluent manner.

Like in the following example:

Assert::that("foo")
    .is("foo")
    .is_not("bar");

When implementing this trait, panic when the assertion fails.

For example the following code should panic:

This example panics
Assert::that("foo").is("bar");

Required methods

pub fn is(self, expected: R) -> Self[src]

Assert that self is equal to the expected value.

pub fn is_not(self, other: R) -> Self[src]

Assert that self is not equal to the other value.

Loading content...

Implementors

impl<T, R> AssertEquals<R> for Assert<T> where
    T: PartialEq<R> + Debug,
    R: Debug
[src]

Default implementation of AssertEquals.

Loading content...