[rspec-users] Another attempt for a succinct model validation DSL
David Chelimsky
dchelimsky at gmail.com
Mon Jun 4 00:36:10 EDT 2007
On 6/3/07, nicholas a. evans <nick at ekenosen.net> wrote:
> 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://svn.ekenosen.net/public/rspec_validation_matcher/
>
> 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. :-)
Personally, I think @person.should accept("Danny", "Elfman")
;)
>
> --
> Nick
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
More information about the rspec-users
mailing list