0.0
No commit activity in last 3 years
No release in over 3 years
RSpec Base Matcher implementation with automatic registration as a module.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Project Readme

RSpec::Matcher

Gem Version Code Climate GPA Code Climate Coverage Gemnasium Status Travis CI Status Inch CI Gitter

Table of Contents

  • Features
  • Requirements
  • Setup
  • Usage
  • Tests
  • Versioning
  • Code of Conduct
  • Contributions
  • License
  • History
  • Credits

Features

  • Implementes RSpec matcher interface as a module.
  • Registers matcher with RSpec.
  • It is stable in contrast to RSpec::Matchers::BaseMatcher.
  • Well tested and documented.

Requirements

  1. MRI 2.1.0

Setup

For a secure install, type the following (recommended):

gem cert --add <(curl -Ls https://raw.githubusercontent.com/pekhee/rspec-matcher/master/pekhee.pem)
gem install rspec-matcher --trust-policy MediumSecurity

NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification while allowing the installation of unsigned dependencies since they are beyond the scope of this gem.

For an insecure install, type the following (not recommended):

gem install rspec-matcher

Add the following to your Gemfile:

gem "rspec-matcher"

Usage

API Reference

class BeNilMatcher
  include RSpec::Matcher
  register_as "be_nil"

  def match
    actual.nil?
  end

  def failure_message
    "expected #{expected} to be nil"
  end
end

expect(nil).to be_nil

Tests

To test, run:

bundle exec rake

Versioning

Read Semantic Versioning for details. Briefly, it means:

  • Patch (x.y.Z) - Incremented for small, backwards compatible bug fixes.
  • Minor (x.Y.z) - Incremented for new, backwards compatible public API enhancements and/or bug fixes.
  • Major (X.y.z) - Incremented for any backwards incompatible public API changes.

Code of Conduct

Please note that this project is released with a CODE OF CONDUCT. By participating in this project you agree to abide by its terms.

Contributions

Read CONTRIBUTING for details.

License

Copyright (c) 2016 Pooyan Khosravi. Read the LICENSE for details.

History

Read the CHANGELOG for details. Built with Gemsmith.

Credits

Developed by Pooyan Khosravi at Pooyan Khosravi.