Skip to content
Specing framework.
Ruby Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
bin
examples
img
lib
.gitignore
.rubocop.yml
.rubocop_todo.yml
.simplecov
.travis.yml
.yardopts
CODE_OF_CONDUCT.md
Gemfile
Gemfile.lock
LICENSE.md
README.md
Rakefile
VERSION.semver
fix.gemspec

README.md

Fix

Build Status Code Climate Gem Version Inline docs Documentation Gitter

Specing framework for Ruby.

Installation

Add this line to your application's Gemfile:

gem 'fix', '>= 1.0.0.beta4'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fix --pre

Example

Given this app:

# examples/duck/app.rb
class Duck
  def walks
    'Klop klop!'
  end

  def swims
    'Swoosh...'
  end

  def quacks
    puts 'Quaaaaaack!'
  end
end

When you run this:

# examples/duck/fix.rb
require_relative 'app'
require_relative '../../lib/fix'

@bird = Duck.new

Fix(@bird) do
  on :swims do
    it { MUST eql 'Swoosh...' }
  end

  on :speaks do
    it { MUST raise_exception NoMethodError }
  end

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

Then the output should look like this:

ruby examples/duck/fix.rb
examples/duck/fix.rb:8: Success: expected to eql "Swoosh...".
examples/duck/fix.rb:12: Success: undefined method `speaks' for #<Duck:0x00007fe3be868ea0>.
examples/duck/fix.rb:16: NoMethodError: undefined method `sings' for #<Duck:0x00007fe3be868ea0>.

Contact

Versioning

Fix follows Semantic Versioning 2.0.

License

The gem is available as open source under the terms of the MIT License.


This project is sponsored by:
Sashite

You can’t perform that action at this time.