Matchi::Rspec
Extend Matchi matchers with RSpec's ones.
Contact
- Home page: https://github.com/fixrb/matchi-rspec
- Bugs/issues: https://github.com/fixrb/matchi-rspec/issues
- Support: https://stackoverflow.com/questions/tagged/fixrb
Rubies
Installation
Matchi::Rspec 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 https://raw.github.com/fixrb/matchi-rspec/master/certs/gem-fixrb-public_cert.pem)
$ gem install matchi-rspec -P HighSecurity
The HighSecurity trust profile will verify all gems. All of Matchi::Rspec's dependencies are signed.
Usage
List all matchers
Matchi.constants # => [:BeFalse, :BeNil, :BeTrue, :Eql, :Equal, :Match, :RaiseException, :Be, :BeInstanceOf, :Eq]
Built-in RSpec matchers
Identity matcher:
be = Matchi.fetch(:Be, 42)
be.matches? { 42 } # => true
Type/class matcher:
be_instance_of = Matchi.fetch(:BeInstanceOf, String)
be_instance_of.matches? { 'foo' } # => true
Equivalence matcher:
eq = Matchi.fetch(:Eq, 'foo')
eq.matches? { 'foo' } # => true
Security
As a basic form of security Matchi::Rspec 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/matchi-rspec-0.1.0.gem
0decb77665ae868584aedab6ef126c7ce4efa69bf1fab75215ee9686b16525f8d7a45e03dc3145cb320371d8ddf2ffff90de34f5778fe55b11ce4cb4996a7f5a pkg/matchi-rspec-0.1.0.gem
Versioning
Matchi::Rspec follows Semantic Versioning 2.0.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
License
See LICENSE.md file.