Permalink
Browse files

improve the readme and alias have_attribute and have_attributes

  • Loading branch information...
1 parent cd73aee commit ee2cf875b184f8a0dbee79b7c0b93f163a65dcf4 @shingara committed Sep 18, 2012
Showing with 17 additions and 0 deletions.
  1. +16 −0 README.md
  2. +1 −0 lib/virtus-rspec/virtus_attribute.rb
View
@@ -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
@@ -34,5 +34,6 @@ def description
def have_attributes(*args)
HaveAttributeMatcher.new(*args)
end
+ alias :have_attribute :have_attributes
end
end

0 comments on commit ee2cf87

Please sign in to comment.