caramelo 0.1.0

Idiomatic unit test framework for rust
Documentation
use crate::Matcher;
use std::fmt::Debug;

/// Creates a matcher that matches values not equal to the given value
pub fn ne<T>(value: T) -> NotEqual<T> {
    NotEqual(value)
}

/// Matcher that matches values not equal to the given value
pub struct NotEqual<T>(T);

impl<T> Matcher<T> for NotEqual<T>
where
    T: PartialEq + Debug,
{
    fn matches(&self, value: &T) -> bool {
        self.0 != *value
    }

    fn description(&self) -> String {
        format!("not equal to {:?}", self.0)
    }
}