Skip to content

Commit

Permalink
improve the readme and alias have_attribute and have_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
shingara committed Sep 18, 2012
1 parent cd73aee commit ee2cf87
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/virtus-rspec/virtus_attribute.rb
Expand Up @@ -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.