You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This gem provides shoulda-style matchers for Rspec to GrapeEntity.
Currently compatible Rspec 3.
Using the Matchers
Here are some examples of the matchers in use:
it{is_expected.torepresent(:date_of_birth).as(:birthday)}it{is_expected.to_notrepresent(:name).as(:birthday)}it{is_expected.to_notrepresent(:date_of_birth)}it{is_expected.torepresent(:secret).when(:authorized?=>true)}it{is_expected.to_notrepresent(:secret).when(:authorized?=>false)}it{is_expected.torepresent(:super_dooper_secret).as(:top_secret).when(:authorized?=>true)}it{is_expected.to_notrepresent(:super_dooper_secret).as(:top_secret).when(:authorized?=>false)}it{is_expected.torepresent(:dog).using(PetEntity)}it{is_expected.torepresent(:cat).as(:kitty).using(PetEntity)}it{is_expected.torepresent(:name).with_documentation(type: String)}it{is_expected.todocument(:name).with(type: String,desc: 'Name of the person')}it{is_expected.todocument(:name).type(String).desc('Name of the person')}
Support for Rspec 2.0.0
Rspec 2.0.0 is no longer supported. For Rspec 2 use version 0.4.0.
Minitest
It's coming next.
Installation
Add this line to your application's Gemfile:
gem 'grape-entity-matchers', :group => :test
And then execute:
$ bundle
Or install it yourself as:
$ gem install grape-entity-matchers
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 new Pull Request
License
MIT License. See LICENSE for details.
Copyright
Copyright (c) 2014 Mark Madsen, and AGiLE ANiMAL INC.
About
Shoulda-style matchers to help with testing grape entities.