Smoothy
Write smooth assertions in a fluent and readable way.
Features
The crate is heavily inspired by AssertJ
- simple and readable syntax
- assertions based on the type of the asserted value
- assertion values use type conversion traits to make assertions readable
Examples
All asserted are stared by calling assert_that on a value.
After that various assertions based on the type of the asserted value can be made.
use assert_that;
assert_that.equals;
use assert_that;
assert_that.try_into_equals;
use assert_that;
assert_that.equals;
use assert_that;
let result: = Ok;
assert_that
.is_ok
.and_value
.equals;
use assert_that;
let result: = Err;
assert_that
.is_err
.and_error
.to_string
.equals;
use assert_that;
let option: = None;
assert_that.is_none;
use assert_that;
let option: = Some;
assert_that
.is_some
.and_value
.equals
TODO:
- vec support (length, contains)
- string support (length, contains, starts_with, ends_with)