redding / assert

Assertion style testing framework.
https://github.com/redding/assert
MIT License
10 stars 1 forks source link

add `assert_that` assertion helper; add `Assert::ActualValue` #297

Closed kellyredding closed 4 years ago

kellyredding commented 4 years ago

This enables defining assertions in the form:

assert_that(1).equals(1)

This form removes the ambiguity of the argument order in the original assertion helpers and reads more like a formal assertion. This is just another way to write tests and keeps Assert flexible and un-imposing on the style that tests are written in.

Other Changes

rewrite Assert's test suite to use assert_that assertions

This rewrites all of the tests in Assert to use the assert_that assertion style where possible. This not only provides a rich system test for assert_that, there is no loss of coverage b/c assert_that calls the original assertion helpers.

The main win in switching to this style is that it removes the argument order ambiguity of expected vs actual values when they are passed to the assertion helpers.