Matchi::Fix
Matchi-compatible matcher for testing implementations against Fix specifications.
Installation
Add this line to your application's Gemfile:
gem "matchi-fix"And then execute:
bundle installOr install it yourself:
gem install matchi-fixDescription
A Matchi-compatible matcher that allows testing objects against Fix specifications. Enables verification of implementation conformance to Fix test specifications across different testing frameworks like Minitest and RSpec. Integrates seamlessly with the Fix testing framework's powerful specification system while maintaining Matchi's clean matcher interface.
Usage
To make Matchi::Fix available:
require "matchi/fix"The Fix matcher allows testing values against Fix specifications. After requiring matchi-fix, you can use the Fix matcher in your tests through anonymous specification:
Matchi::Fix.new { it MUST be 42 }.match? { 42 } # => trueor through registered specification by name:
# First, define a Fix specification
Fix :Calculator do
on(:add, 2, 3) do
it MUST eq 5
end
on(:multiply, 2, 3) do
it MUST eq 6
end
end
# Then use the matcher to test implementations
calculator = MyCalculator.new
# Using direct matcher syntax
Matchi::Fix.new(:Calculator).matches?(calculator) #=> true/falseError Handling
On missing specifications:
Matchi::Fix.new(:NonExistent)
# => KeyErrorOn passing both specification name and specification code:
Matchi::Fix.new(:SpecName) { "Spec block" }
# => ArgumentErrorContact
- Source code: https://github.com/fixrb/matchi-fix
Versioning
Matchi::Fix follows Semantic Versioning 2.0.
License
The gem is available as open source under the terms of the MIT License.
Sponsors
This project is sponsored by Sashité