Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Shoulda-style RSpec/Test Unit matchers for the Representable Gem
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml
Gemfile
LICENSE.txt
README.md
Rakefile
representable_matchers.gemspec

README.md

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) }

Credits

Authored by Adam Cuppy (@acuppy) of Coding ZEAL (http://codingzeal.com)

Coding ZEAL

This is freely distributed under the MIT license. Use it, modify it, enjoy :)

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
Something went wrong with that request. Please try again.