I appreciate that testing every single line off code isn't the approach of BDD, and indeed that isn't my goal, although at the same time I'd like to be able to "see" with coverage reports just to what extent the code base is explicitly tested.
<br><br>Say I had ViewA that uses HelperA and ViewB that uses HelperB, ViewA and HelperA both have specs, as does ViewB, however HelperB does not. With an rcov coverage report this isn't visible, what I'm after is something that can tell me "HelperB was executed during the running of ViewB, but its behavior was not explicitly specified."
<br><br>It'd like to look into seeing if this is possible with rspec, I'll have to try convince my boss to allow me to devote some time to it.<br><br>Cheers<br>Ian<br><br><div><span class="gmail_quote">On 20/06/07,
<b class="gmail_sendername">Scott Sehlhorst</b> <<a href="mailto:scott@tynerblain.com">scott@tynerblain.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<span class="q"><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">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.
<br><br>Aslak</blockquote></span><div><br>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.<br>
<br>
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.<br>
<br>
my two cents<br>
Scott Sehlhorst<br><a href="http://tynerblain.com/blog" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://tynerblain.com/blog</a><br></div><br>
<br>_______________________________________________<br>rspec-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">
http://rubyforge.org/mailman/listinfo/rspec-users</a><br></blockquote></div><br>