Cross-referenced code coverage reports, which were recently introduced, have been expanded to indicate where methods are called from and which methods were called for each line of code. In addition to that, cross-referenced report generation is now over 4 times faster for applications with deep call stacks (such as Rails apps). As usual, here's a fully cross-referenced report generated by rcov 0.6.0.
The latest rcov release also features a new differential coverage mode (--text-coverage-diff/-D)
which will tell you when you've added new code that was not covered by
the tests. You can save the current coverage status with --save (for instance
on commit), and running rcov with the -D option will tell you which uncovered
code has been introduced since the last save (it'll also tell you when code
which was covered isn't anymore):
!!!!! Uncovered code introduced in app/models/article.rb
### app/models/article.rb:44
# Find all articles on a certain date
def self.find_all_by_date(year, month = nil, day = nil)
!! from, to = self.time_delta(year, month, day)
!! Article.find(:all, :conditions => ["articles.created_at BETWEEN ? AND ? AND articles.published != 0", from, to], :order => 'articles.created_at DESC', :include => [:categories, :trackbacks, :comments])
!! end
# Find one article on a certain date
def self.find_by_date(year, month, day)
!! find_all_by_date(year, month, day).first
!! end
# Finds one article which was posted on a certain date and matches the supplied dashed-title
def self.find_by_permalink(year, month, day, title)
rcov 0.6.0 ships with a compiler plugin for vim
(contributions for other editors/IDEs welcome).
Download
Either install from the sources or using RubyGems (gem install rcov). A binary package for win32 is available.