Minitest::ExtendedAssertions
Extended assertions for Minitest
Installation
Add this line to your application's Gemfile:
gem 'minitest-extended_assertions'
And then execute:
$ bundle
Or install it yourself as:
$ gem install minitest-extended_assertions
Usage
Hash
expected = {a: 1, b: 2}
actual = {a: 2, b: 1}
assert_equal_hash expected, actual
actual.must_equal_hash expected
Array
expected = [1, 2, 3, 4]
actual = [1, 20, 3, 40]
assert_equal_array expected, actual
actual.must_equal_array expected
JSON
expected = '{"a": 1, "b": 2}'
actual = '{"a": 2, "b": 1}'
assert_equal_json expected, actual
actual.must_equal_json expected
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/gabynaiman/minitest-extended_assertions.
License
The gem is available as open source under the terms of the MIT License.