hey there,
I have a question that may be raised from some misunderstanding of my
current problem. But the answer might well serve me for other things.

The issue is I would like to be able to metaprogramatically (this may be a
bad chosen word) generate spec examples to check a model is valid against
its 'validates_presence_of' declarations, do something like
http://gist.github.com/175083

where you iterate over an array of known required attributes and then
generate the typical %{it 'should require required attribute'} spec example.
That's easy with shoulda, but in this case the validations are contextual,
they have the :if => xxx option, and shoulda doesn't support them (yet)

If not answering my former question: how you attack normally this problem?
any ideas? I know I could go the common finger-hurting way of writing lots
of alike examples :-) and also that there are concerns regarding spec-ing my
specs and mostly when using this kind of artifacts, but well...

what would you do?

thanks in advance
joaquin

-- 
www.least-significant-bit.com
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to