/representable_matchers

Shoulda-style RSpec/Test Unit matchers for the Representable Gem

Primary LanguageRubyMIT LicenseMIT

Representable Matchers

Build Status Code Climate Gem Version

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request