How much test data to use in specs

On 2008-08-29, at 11:05, David C. wrote:

I stopped using it after a while finding the tests did not read
Thanks for the vote of confidence, Joseph! I have two other methods
nils and will give you a meaningful error if there is a problem with
your factory. What’s your goal here?

Hi David. My goal with these methods is to automate the speccing of
model attributes and reduce the amount of code that needs to be written.

I created #describe_model_factory so that there would be a spec
specifically for the factories that I create, rather than relying on
other specs to indirectly ensure that my factories work properly.

Looking at the methods again, you’re correct that
#describe_model_attribute includes most of the functionality of
#check_model_attributes_when_nil . That’s not very DRY then, eh? I
should probably get rid of #check_model_attributes_when_nil , and add
an argument to #describe_model_attribute that allows the user to
specify whether or not an error message should exist when the
attribute being specced is invalid.

How does that sound?
-Nick

On 2008-08-29, at 04:51, Joseph W. wrote:

Thanks!

Joseph W.
http://www.joesniff.co.uk

Thanks for the vote of confidence, Joseph! I have two other methods
that go alongside #describe_model_attribute which you might find
useful. I’m in the process of wrapping them up into a plugin. Until
that’s finished, I’ve pasted them at http://pastie.org/262508 and
http://pastie.org/262509
.

Cheers,
Nick