redding / assert

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

remove Test::Unit; add new assertion helpers; allow passing block actual values via block slot #303

Closed kellyredding closed 3 years ago

kellyredding commented 3 years ago

remove support of Test::Unit style test methods, e.g. def test_whatever

This addresses Issue #244.

This was originally added, many years ago, to maintain backwards compatibility with Test::Unit tests. This is no longer desired so we are removing the legacy code.

add .is and .is_not actual value assertion methods

This addresses Issue #302. These are just shorter aliases for .is{not_}_the_same_as that are less to type.

add assert_changes, .changes assertion helpers

This closes Issue #301.

This is an assertion helper to test before/after states of a bit of code.

allow passing a block to assert_that

This addresses Issue #300.

This is a more convenient/standard way to get actual values that should be procs. You can still manually pass a proc in as a proc actual value OR you can use the block slot to pass in a proc actual value implicitly.

This also added Assert::ActualValue.not_given to use to know whether a non-block-slot actual value was given or not. I can't do nil or "truthy" checks as these actual values could be anything. Using the "not given" pattern ensures this will work with any value.