[rspec-users] Is #valid? automatically called?

Tero Tilus tero at tilus.net
Thu Feb 12 23:31:00 EST 2009

2009-02-12 15:42, Pat Maddox:
>> The fact that you are asking this shows that we're violating the
>> principle of least surprise.
> Yes it's a surprise

How do you know #errors_on not implicitly validating wouldn't be
bigger surprise?  Say 30 (instead of three now surprised) people would
be surprised.

Would documenting implicit validation on code comments.  Now it only
says "Extension for should have on AR Model instances" on #errors_on.
And imo it could very well say "Calls #valid? before returning list of
errors." too, although seeing that yourself from source is only one
click away if you you have dug yourself that deep in rspec-rails rdoc.

Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/

More information about the rspec-users mailing list