Expect
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
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:
Expect.this { 'foo' }.not_to Eql: 'bar' # => true
Identity expectation:
Expect.this { :foo }.to Equal: :foo # => true
Regular expressions expectation:
Expect.this { 'foo' }.to Match: /^foo$/ # => true
Expecting errors expectation:
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.
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.