0.0
No commit activity in last 3 years
No release in over 3 years
Rspec matchers to combine matchers together
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 2.11
 Project Readme

Build Status Test Coverage Code Climate

Maintainers Wanted

Repo Status Unsupported Maintainers Wanted

This lib used to work with previous versions of RSpec, unfortunately, I don't have the time to maintain it anymore. I'm not even sure it would be useful with newer versions of RSpec.

SpecCombos

Rspec 2.0 matchers that can combine other matchers together, to allow precise testing elements of a sequence for example. The goal is to get :

  • concise and readable specs
  • factorized code
  • explicit assertion failure messages

Similar matchers are built-in Rspec 3.0.

Installation

Add this line to your application's Gemfile:

gem 'spec_combos'

And then execute:

$ bundle

Or install it yourself as:

$ gem install spec_combos

Usage

The matchers can be used like any matcher, just taking other matchers as arguments.

All matcher

expect([1,3,5]).to all_ { be_odd }

Any matcher

expect([2,1,4]).to have_any_that { be_odd }

And matcher

expect(2).to and_(be_even, be_instance_of(Fixnum))

It can be composed with 'any' or 'all' matchers :

expect([1,3,5]).to all_ { and_(be_odd, be_instance_of(Fixnum)) }

Contributing

  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 new Pull Request