Spectus
Expectation library with RFC 2119's requirement levels, and some matchers for Ruby.
Contact
- Home page: https://github.com/fixrb/spectus
- Bugs/issues: https://github.com/fixrb/spectus/issues
- Support: https://stackoverflow.com/questions/tagged/spectus
Rubies
Installation
Add this line to your application's Gemfile:
gem 'spectus'
And then execute:
$ bundle
Or install it yourself as:
$ gem install spectus
Usage
Absolute requirement definition:
Spectus.this { 'foo'.upcase }.MUST eql: 'FOO' # => true
Absolute prohibition definition:
Spectus.this { 'foo'.length }.MUST_NOT equal: 42 # => true
Recommended definition:
Spectus.this { 'foo'.valid_encoding? }.SHOULD equal: true # => true
Not recommended definition:
Spectus.this { ''.blank? }.SHOULD_NOT raise_exception: NoMethodError # => true
Optional definition:
Spectus.this { 'foo'. }.MAY match: /^foo$/ # => true
Versioning
Spectus 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