[rspec-users] MockCov: Proof of concept
mailing_lists at railsnewbie.com
Thu Jul 26 15:39:00 EDT 2007
Yeah - I think that's a neat idea too.
Does the code only work with RSpec's mocking framework? Maybe it
could be integrated into Rcov somehow.
On Jul 25, 2007, at 12:27 PM, Marcus Ahnve wrote:
> Really cool - I have asked myself that question several times.
> On 7/25/07, Ian Leitch <port001 at gmail.com> wrote:
>> Hey list,
>> RSpec is great, I've been using it at work for a couple of months
>> now. One
>> gripe I have is that I find it hard to know exactly to what extent
>> my code
>> is covered by the specs. I am aware of RCov and Heckle; they're
>> great, but
>> I'd like to demonstrate another perspective of coverage analysis
>> I've hacked
>> The perspective is that of what is mocked and what isn't, with RCov
>> execution analysis mixed in for better viewing. My itch was "To
>> what extent
>> is my code mocked?" -- hence the name MockCov.
>> It produces a report for each file with stubbed methods and
>> executed lines
>> highlighted. From that I can easily see what my specs failed to
>> mock and
>> therefore most probably didn't specify any kind of behavior for.
>> Here is a sample report:
>> (please forgive the small size of this sample, my employer
>> didn't want me showing too much of our code)
>> You'll notice that there isn't any kind of statistical coverage
>> summary, I'm
>> not sure how to quantity the results and indeed haven't spent any
>> thinking about it; that can come later. For now I'd just like to
>> gauge the
>> response to this.
>> I haven't packaged the code up yet, it's a horrible hack and needs
>> to be
>> reworked from scratch; I need to talk with someone on how best to
>> it with RSpec before that happens though.
>> Let me know your thoughts.
>> rspec-users mailing list
>> rspec-users at rubyforge.org
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users