diff --git a/README.md b/README.md index 854cb3f..a6e98e9 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,22 @@ RSpec.configure do |configuration| 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 1. Fork it diff --git a/lib/virtus-rspec/virtus_attribute.rb b/lib/virtus-rspec/virtus_attribute.rb index c42e2eb..496ebe1 100644 --- a/lib/virtus-rspec/virtus_attribute.rb +++ b/lib/virtus-rspec/virtus_attribute.rb @@ -34,5 +34,6 @@ def description def have_attributes(*args) HaveAttributeMatcher.new(*args) end + alias :have_attribute :have_attributes end end