NDD RSpec

RSpec utilities.

The API documentation can be find at RubyDoc.

Installation

Add this line to your application's Gemfile:

gem 'ndd-rspec-rails'

And then execute bundle

Or install it yourself with gem install ndd-rspec-rails

Usage

Prerequisites

This gem requires:

And is tested with:

be_sorted_by

expect(%w[1 2 3]).to be_sorted_by(:to_i)  # => success
expect(%w[1 3 2]).to be_sorted_by(:to_i)  # => failure

be_reverse_sorted_by

expect(%w[3 2 1]).to be_reverse_sorted_by(:to_i)  # => true
expect(%w[1 3 2]).to be_reverse_sorted_by(:to_i)  # => false

Development

Prerequisites

In order to extensively test this library with all the supported versions of Ruby and RSpec, you will need to manage:

Setup

After installing RVM, check out the repository and run bin/setup to setup all the environments. This script will:

rvm use
gem install bundler --no-rdoc --no-ri
bundle install
export LOCAL_RUBY_VERSION=2.2.7 \
 && rvm install ruby-$LOCAL_RUBY_VERSION \
 && rvm use ruby-$LOCAL_RUBY_VERSION \
 && gem install bundler --no-rdoc --no-ri
export LOCAL_RUBY_VERSION=2.3.4 \
 && rvm install ruby-$LOCAL_RUBY_VERSION \
 && rvm use ruby-$LOCAL_RUBY_VERSION \
 && gem install bundler --no-rdoc --no-ri
export LOCAL_RUBY_VERSION=2.4.1 \
 && rvm install ruby-$LOCAL_RUBY_VERSION \
 && rvm use ruby-$LOCAL_RUBY_VERSION \
 && gem install bundler --no-rdoc --no-ri
appraisal install
wwtd --only-bundle

At last, to test this library in all the supported environments, just run:

wwtd --parallel

Release

As a reminder…

bundle update
appraisal update
wwtd --only-bundle

Contributing

Bug reports and pull requests are welcome on GitHub at github.com/ddidier/ndd-rspec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

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