[rspec-users] validate_presence_of

David Chelimsky dchelimsky at gmail.com
Thu Feb 19 09:55:13 EST 2009

On Wed, Feb 18, 2009 at 11:40 PM, Stephen Eley <sfeley at gmail.com> wrote:

> If your spec breaks because you changed a method call, you're not
> testing behavior any more.  You're testing syntax.

We've got to stop making laws out of guidelines. This is a very
general statement about what is really a very specific situation, and
it is not in any way as black and white as this statement sounds. But
*somebody* is going to read this, not understand the context, and
think it's international law.

Code examples are clients of the subject code, just like any other
clients that are part of the subject code. You don't expect all of the
other objects in your app to work correctly when you change a method
name in only one place, do you? You need to change all the clients,
including the code examples.

In Chicago we don't have any j-walking laws (at least that I know of -
I've yet to be arrested for it). The guideline we operate under is
that you should wait for the light, but we don't always follow that
guideline. When I'm at an intersection and don't have the light, I
look both ways, like I learned back in kindergarten, and cross if its
safe. If there are no cars coming, I'm very likely to survive the
incident. If there are cars coming, I can still navigate my way across
the street and, if I do so carefully, correctly, and with precise
timing, I might well survive.

Guidelines are great tools, but if we followed guidelines like laws
we'd never get where we're going.


More information about the rspec-users mailing list