Hamcrest-style composable matchers for Minitest. Write expressive, readable assertions with detailed failure messages.
- Fluent assertion API with
assert_that - Composable matchers using
&(AND) and|(OR) operators - Deep equality comparison for arrays and hashes with detailed diffs
- Reference equality testing
- Logical combinators:
all_of,none_of,some_of - Descriptive failure messages that pinpoint exactly what went wrong
- Extensible: create and register your own custom matchers
Add to your Gemfile:
gem 'minicrest'Then run:
bundle installInclude Minicrest::Assertions in your test class:
require 'minicrest'
class MyTest < Minitest::Test
include Minicrest::Assertions
def test_basic_equality
assert_that(42).equals(42)
end
endSee USAGE.md for more details and a full list of available matchers.
To run the library's own tests:
rake testAGPL-3.0-only
See LICENSE for details.