Project

minicrest

0.0
No release in over 3 years
Minicrest provides Hamcrest-style composable matchers for Minitest with expressive, readable assertions and detailed failure messages. Matchers can be combined using logical operators to create complex matching conditions.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 5.0
 Project Readme

Minicrest

CI

Hamcrest-style composable matchers for Minitest. Write expressive, readable assertions with detailed failure messages.

Documentation

Features

  • 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

Installation

Add to your Gemfile:

gem 'minicrest'

Then run:

bundle install

Usage

Include 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
end

See USAGE.md for more details and a full list of available matchers.

Running Tests

To run the library's own tests:

rake test

License

AGPL-3.0-only

See LICENSE for details.