[rspec-users] Another attempt for a succinct model validation DSL

Joseph Method tristil at gmail.com
Mon Jun 4 15:37:23 EDT 2007

This looks right. One thing: I think validation_for inserts behaviors
into the example. I mean, that's how I think it should be implemented.
The question is, how many are there in the first example? How about 3?
 That is:

- Person validates :firstname (not nil, "foo" okay, not "bar")
- Person validates :firstname should reject "" with 'can't be blank' message
- Person "should reject a super long firstname"

The .because("should reject a super long firstname") syntax in my
example would be equivalent to the third example.

> I strongly agree.  I will gladly sacrifice a little bit of concision
> in order to stay in the rspec readability/behavior/specification
> paradigm.  But I do want to (as much as is possible) remain in The
> Rspec Way with as little verbosity and noise distracting from the
> examples as is reasonable.  David, Aslak, oh wise guardians and
> mentors of The Rspec Way, what do you think of my latest pastie?
> http://pastie.caboo.se/67605  :-)
> --
> Nick

-J. Method

More information about the rspec-users mailing list