Fixrb is the home of Fix, a Ruby gem built around a simple idea: a specification should describe what a subject must, should or may do, without saying anything about how it is implemented. Specifications are written once as documents and kept apart from any particular implementation, then tested against whatever subject you choose.
The core workflow is compact. You declare a specification with Fix and a name, list expectations using RFC 2119 wording such as MUST, SHOULD and MAY, and then run it against a subject like an Array, your own class or a library you depend on. Output is one line per expectation, and the process exit status reflects the overall result. Under MAY, a missing method is reported as info and the run still passes.
Because specifications are loaded as plain documents, there is no setup, mocking or logic inside them, which keeps them stable and reusable across versions. This makes Fixrb most useful to Ruby developers who want to pin down behaviour contracts, compare implementations against a shared spec, or test libraries they rely on.
To get started, install the gem with gem install fix on Ruby 3.3 or later, require it, and write a small specification to try against an existing object. The project is MIT licensed and its source is available on GitHub, so you can read the code and examples before adopting it.
Comments & Ratings
0No comments yet. Be the first to review.