Awesome
Virtus::Rspec
Rspec matcher to virtus gem
Installation
Add this line to your application's Gemfile:
gem 'virtus-rspec'
And then execute:
$ bundle
Or install it yourself as:
$ gem install virtus-rspec
Usage
You need include the Virtus::Matchers in your rspec config file
RSpec.configure do |configuration|
configuration.include Virtus::Matchers
end
You have now access to have_attribute
matcher.
class Post
include Virtus
attribute :title, String
attribute :first_name, String
attribute :last_name, String
end
describe Post do
it { should have_attribute(:title) }
it { should have_attributes(:first_name, :last_name) }
end
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