- continuous integration
Bonus assertions for Minitest, providing assertions I use frequently, supporting only Ruby 2.0 or better.
assert_false: requires that the value be exactly
assert_true: requires that the value be exactly
assert_between: requires that the value be strictly between the low and high values provided, or the range (this test is boundary-exclusive). (
refute_missing_keys: requires that the object contains all of the keys expected. (
refute_has_keys: requires that the object not have any of the keys expected. (
assert_raises_with_message: requires that the exception raised in the provided block has a specific message (tested with
assert_set_equal: requires that the actual enumerable have the same values as the expected enumerable, without regard to order and ignoring duplicate values. (
refute_set_equal: requires that the actual enumerable not have the same values as the expected enumerable. (
assert_result_equal: requires that the actual is equal to the result of evaluating an expression.
I am also providing the Minitest-tester code I use as something that can be required by other developers. This should only be used to test Minitest assertions and extensions. For more information on Minitest::AssertionTests, see its documentation.
minitest-bonus-assertions started life as a patch to Ben Somer’s minitest-extra-assertions. There were some nice assertions included, but there were other changes that needed to be made to bring it up to support Minitest 5. There was also an override to the default
assert_match implementation meant to ease the transition from Test::Unit (the main reason he wrote this assertion plugin for Minitest in the first place). I do not believe this is sensible five major versions into Minitest: I removed it. Ben did not feel comfortable making this particular change, so I felt that the best way to provide the original assertions and my new assertions—without the
assert_match override—was to fork this as a new project. I am indebted to Ben and his contributors for writing these assertions in the first place.
Add it to your Gemfile:
gem 'minitest-bonus-assertions', '~> 1.1'
Or manually install:
% gem install minitest-bonus-assertions
minitest-bonus-assertions Semantic Versioning¶ ↑
minitest-bonus-assertions uses a Semantic Versioning scheme with one change:
When PATCH is zero (
0), it will be omitted from version references.