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
Add this line to your application's Gemfile:
gem 'expect'
And then execute:
$ bundle
Or install it yourself as:
$ gem install expect
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
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