On 8 Jan 2008, at 19:14, Daniel Tenner wrote:

> Might be a personal thing, but my approach is that I try to test the
> public behaviour of the object. Testing private methods is, imho,
> getting dangerously close to specifying how the object does its
> business, rather than what it does.
>

If you're a proponent of many-skinny-methods then you wind up with a  
lot of public methods which should never need to be called by another  
object, so making them private can be a good thing for general users  
of the object.


> I would just spec the externally visible behaviour, where it occurs,
> and let the object implement it as it wants (using private methods or
> any other mechanism).
>

If the object were to implement it itself, that would be great ;-)  
Unfortunately, I have to implement the innards, and I'm rubbish so I  
like to test things...

Matt

-- 
   Matt Patterson | Design & Code
   <matt at reprocessed org> | http://www.reprocessed.org/


_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to