There should be convenience methods to compare strings while ignoring casing and/or whitespace, such that e.g. "abc" is considered equal to "ABC" and/or " a b c ".
A potential design decision is whether each possible assertion is implemented directly on the AssertThat struct or whether there is an intermediate step to specify which aspects to ignore. In the first case, an example assertion would look like this:
assert_that!("an example string").contains_ignoring_case("example");
In the second case, the same assertion would look as follows:
assert_that!("an example string").ignoring_case().contains("example");
The first one would have the advantage of being potentially more readable and easier to implement, the latter would avoid spamming the documentation and auto-completion with similar methods.
There should be convenience methods to compare strings while ignoring casing and/or whitespace, such that e.g. "abc" is considered equal to "ABC" and/or " a b c ".
A potential design decision is whether each possible assertion is implemented directly on the
AssertThatstruct or whether there is an intermediate step to specify which aspects to ignore. In the first case, an example assertion would look like this:In the second case, the same assertion would look as follows:
The first one would have the advantage of being potentially more readable and easier to implement, the latter would avoid spamming the documentation and auto-completion with similar methods.