This formatter loads SimpleCov a code coverage reporting tool for Ruby 1.9. SimpleCov already does a good job in making it really easy to configure and load itself, but even good efforts can be improved upon.
The only problem is that you'll need to have something like a spec_helper to load it. You might not have this or you might find it ugly having to resort to environment variables to turn it off or on.
With this formatter, SimpleCov will start, and it will load a .coverage
file in which you can add ruby code to configure SimpleCov in a non-obtrusive way. Configuration for a typical Rails app will look like this:
SimpleCov.start 'rails'
To run this formatter, place it somewhere in your load path (like inside your spec
directory).
This formatter doesn't have any output, so you'll probably want to add another formatter. I prefer the documentation (if the number of specs is limited) or Fuubar formatter (for big spec suites):
rspec spec -f SpecCoverage -f Fuubar
If you are using bundler, then don't forget to add simplecov to your Gemfile
:
gem 'simplecov', :group => :test, :require => false
More information on SimpleCov can be found here.