[rspec-users] RSpec makes me want to write better code

Ashley Moran ashley.moran at patchspace.co.uk
Fri Sep 26 16:01:01 EDT 2008

On Sep 26, 2008, at 6:18 pm, Mark Wilden wrote:

> As part of the TDD process, I spec all attributes, but this doesn't  
> seem universal. Is this a misconception? Do people actually make  
> sure that all columns exist and can be written to and read from?

What I meant by this was that say you have classes...

Animal {weight, height, dob}
Pet < Animal {name}
ZooAnimal < Animal {cage_id}

then, using ActiveRecord, all three will have attributes {weight,  
height, dob, name, cage_id}.  If you don't want your pets in a cage,  
it's worth preventing that and writing specs for it.

That's what I was getting at, really - the extra data corruption issues.



More information about the rspec-users mailing list