# Expect [![Build Status](https://travis-ci.org/fixrb/expect.svg?branch=master)][travis] [![Gem Version](https://badge.fury.io/rb/expect.svg)][gem] [![Inline docs](http://inch-ci.org/github/fixrb/expect.svg?branch=master)][inchpages] [![Documentation](http://img.shields.io/:yard-docs-38c800.svg)][rubydoc] > Expectation library with some built-in matchers for Ruby. ## Contact * Home page: https://github.com/fixrb/expect * Bugs/issues: https://github.com/fixrb/expect/issues * Support: https://stackoverflow.com/questions/tagged/expect ## Rubies * [MRI](https://www.ruby-lang.org/) * [Rubinius](http://rubini.us/) * [JRuby](http://jruby.org/) ## Installation __Expect__ 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/expect/master/certs/gem-fixrb-public_cert.pem) $ gem install expect -P HighSecurity The `HighSecurity` trust profile will verify all gems. All of __Expect__'s dependencies are signed. ## Usage **Equivalence** expectation: ```ruby Expect.this { 'foo' }.not_to Eql: 'bar' # => true ``` **Identity** expectation: ```ruby Expect.this { :foo }.to Equal: :foo # => true ``` **Regular expressions** expectation: ```ruby Expect.this { 'foo' }.to Match: /^foo$/ # => true ``` **Expecting errors** expectation: ```ruby Expect.this { Boom }.to RaiseException: NameError # => true ``` ## Security As a basic form of security __Expect__ 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/expect-0.0.1.gem 8c72ec1d93577cf57eaaea04d66287f18673f39cb886452cf7044195c03a77d03a5226a6b033cc6a0992721c7aefcb64c6daca463e7e0b5059901886dfc3cfb2 pkg/expect-0.0.1.gem ## Versioning __Expect__ follows [Semantic Versioning 2.0](http://semver.org/). ## Contributing 1. [Fork it](https://github.com/fixrb/expect/fork) 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 a new Pull Request ## License See `LICENSE.md` file. [gem]: https://rubygems.org/gems/expect [travis]: https://travis-ci.org/fixrb/expect [inchpages]: http://inch-ci.org/github/fixrb/expect/ [rubydoc]: http://rubydoc.info/gems/expect/frames