[rspec-users] Something like rcov but more explicit?

Scott Sehlhorst scott at tynerblain.com
Wed Jun 20 15:04:16 EDT 2007


>
> I'm also sceptical about having a goal along the lines of "all methods in
> our code must be invoked explicitly by specs". It's a very low level (too
> low level IMO) way of approaching the overall behaviour of your app.
>
> Aslak


I would also add that it violates some principals of encapsulation.  If you
expose an object to perform an action, then an rspec test should interact
with that object to test those actions.  And only those actions exposed by
the object.  Unit tests should be the vehicle for testing any methods relied
upon by the "outer object" to accomplish the action.

I am very new to rspec (and rails), but my interpretation of BDD is that it
should honor principles of encapsulation, and unit testing should be used
for low-level testing.  If this is not the spirit of rspec, I would love to
know how other people approach it - then I can fix my misperceptions.

my two cents
Scott Sehlhorst
http://tynerblain.com/blog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070620/3f2eb2e4/attachment.html 


More information about the rspec-users mailing list