Created
May 15, 2012 20:59
-
-
Save avdi/2705101 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe Article do | |
subject | |
def article; Article.new; end | |
it "validates presence of :title" do | |
article.should validate_presence_of(:title) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FWIW, you can already do this:
This gives you the subject/named-thing duality you're looking for, and requires less "magic" than the above (which would need a
method_added
hook, right?). And it already works!