No release in over 3 years
Low commit activity in last 3 years
Bonus assertions for [Minitest][minitest], providing assertions I (used to) use frequently, supporting only Ruby 2.0 or better. > I have not used these regularly for tests in about ten years. They're still > likely good, but I no longer consider them necessary. ==== To Install:
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 4.0
~> 2.1, >= 2.1.1
>= 5.16, < 7
>= 10.0, < 14
>= 0.0, < 7
~> 0.22
~> 1.0
 Project Readme

minitest-bonus-assertions

RubyGems Version Coveralls Build Status

Description

Bonus assertions for Minitest, providing assertions I (used to) use frequently, supporting only Ruby 2.0 or better.

I have not used these regularly for tests in about ten years. They're still likely good, but I no longer consider them necessary.

Features

New assertions:

  • assert_false / must_be_false: requires that the value be exactly false.
  • assert_true / must_be_true: requires that the value be exactly true.
  • assert_between / must_be_between: requires that the value be strictly between the low and high values provided, or the range (this test is boundary-exclusive).
  • assert_has_keys / refute_missing_keys / must_have_keys: requires that the object contains all of the keys expected.
  • assert_missing_keys / refute_has_keys / must_not_have_keys: requires that the object not have any of the keys expected.
  • assert_raises_with_message / must_raise_with_message: requires that the exception raised in the provided block has a specific message (tested with assert_equal).
  • assert_set_equal / must_equal_set: requires that the actual enumerable have the same values as the expected enumerable, without regard to order and ignoring duplicate values.
  • refute_set_equal / must_not_equal_set: 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.

Background

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.

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.