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

aslak hellesoy aslak.hellesoy at gmail.com
Wed Jun 20 18:23:22 EDT 2007

On 6/20/07, Ian Leitch <port001 at gmail.com> wrote:
> 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.
> 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."

If you want to verify how well tested your code is you should look
into branch coverage (RCov first, then Heckle).

It's irrelevant where a method invocation originates from.


> 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.
> Cheers
> Ian
> On 20/06/07, Scott Sehlhorst <scott at tynerblain.com> wrote:
> >
> >
> > > 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
> >
> >
> > _______________________________________________
> > rspec-users mailing list
> > rspec-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-users
> >
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list