Build Status Code Climate Dependency Status Gem Version Inline docs Documentation Gitter

Specing framework for Ruby.




Fix is cryptographically signed.

To be sure the gem you install hasn't been tampered with, add my public key (if you haven't already) as a trusted certificate:

$ gem cert --add <(curl -Ls
$ gem install fix -P HighSecurity

The HighSecurity trust profile will verify all gems. All of Fix's dependencies are signed.

Or add this line to your application's Gemfile:

gem 'fix'

And then execute:

$ bundle

Let's get started!



Simple, stupid

With 174 LOC built on top of Spectus expectation library, facilities such as benchmarking and mocking are not supported. Fix offers however a consistent DSL to focus your BDD.

True specifications

While specs behave like documents which can be logic-less, their interpretation should not be questioned regardless of the version of Fix, preventing from software erosion. Also, Fix specs are compliant with RFC 2119.

Low code complexity

Monkey-patching, magic tricks and friends are not included. Instead, animated by authentic and unmuted Ruby objects, unambiguous, understandable and structured specs are encouraged.

Test in isolation

Rather than a random order option to help finding bugs somewhere (and sometimes luck), Fix prevents from side effects by running each context inside a distinct sub-process. As it behaves like a function, no matter how many times you call it, the build status remains the same.


Given this app:

# duck.rb
class Duck
  def walks
    'Klop klop!'

  def swims

  def quacks
    puts 'Quaaaaaack!'

When you run this:

# duck_spec.rb
require_relative 'duck'
require 'fix'

@bird =

Fix.describe @bird do
  on :swims do
    it { MUST eql 'Swoosh...' }

  on :speaks do
    it { MUST raise_exception NoMethodError }

  on :sings do
    it { MAY eql '♪... ♫...' }

Then the output should look like this:

$ ruby duck_spec.rb

1. Info: undefined method `sings' for #<Duck:0x007fb60383b740> (NoMethodError).

Ran 3 tests in 0.00038 seconds
100% compliant - 1 infos, 0 failures, 0 errors


As a basic form of security Fix provides a set of SHA512 checksums for every Gem release. These checksums can be found in the checksum/ directory. Although these checksums do not prevent malicious users from tampering with a built Gem they can be used for basic integrity verification purposes.

The checksum of a file can be checked using the sha512sum command. For example:

$ sha512sum pkg/fix-0.1.0.gem
d12d7d9c2a4fdfe075cbb7a141fa5f2195175891e4098c7e1a28c8bca655ab44fb9d67b6a2e3991d0f852026c5e4537fdf7e314575c68d1c80b3a4b1eb1c041f  pkg/fix-0.1.0.gem


Fix follows Semantic Versioning 2.0.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


See file.

This project is sponsored by: