Representable Matchers
Shoulda-style RSpec/Test Unit matchers for the Representable Gem
Installation
Add this line to your application's Gemfile:
gem 'representable_matchers'
And then execute:
$ bundle
Or install it yourself as:
$ gem install representable_matchers
Usage
it { should have_representable_property(:name) }
it { should have_representable_collection(:children) }
With submatchers
it { should have_representable_property(:name).klass(String) }
it { should have_representable_property(:class_and_extension).klass(Array).extends(AbstractRepresenter) }
it { should have_representable_collection(:children).klass(Array).extends(AbstractRepresenter).parse_strategy(:sync) }
License
Authored by the Engineering Team of Coding ZEAL
Copyright (c) 2017 Zeal, LLC. Licensed under the MIT license.
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