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

nicholas a. evans nick at ekenosen.net
Sun Jun 3 22:52:04 EDT 2007

On 6/2/07, nicholas a. evans <nick at ekenosen.net> wrote:
> At any rate, I just put together my first draft implementation
> (developed spec-first).  It still doesn't check the error messages
> yet, and it's only handling single fields at the moment, but I'll do
> those after I get home from the market.  After that I'll figure out
> how to get it working with my desired "shortcut" syntax.

So I haven't gotten around to my preferred shortcut syntax yet, but I
did add support to check for error messages and handle multiple
fields, so it should be quite usable now.  I took the approach that
when specifying single field validations it only checks for errors on
that field, but when specifying multi-field validations it checks for
any errors on the object.  That felt like simplest and least
surprising solution to me.  My specs assume that you can use sqlite3
(to do an in-memory DB).


http://pastie.caboo.se/67509 shows what it currently can do, as well
as my current thoughts on how I would *really* like to be doing this.
I'm eager to hear any comments on it.  :-)


More information about the rspec-users mailing list