Project

duvet

0.0
No commit activity in last 3 years
No release in over 3 years
A simple code coverage tool for Ruby 1.9. Add 'Duvet.start' to the top of your test helper, to have it write code coverage stuff to 'cov/'.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Duvet

Install with:

$ gem install duvet

Then add this to the very top of your test/helper.rb (or similar)

require 'duvet'
Duvet.start

Because duvet won't work for Ruby 1.8 you may want to rescue the error and move on,

begin
  require 'duvet'
  Duvet.start
rescue LoadError
  # ignore error
end

You can change the defaults by passing options to Duvet.start, for example:

Duvet.start :dir => 'coverage', :filter => 'app/lib'

Where :dir is the directory to write the coverage to and :filter is a string that a files path must match against. A regular expression can be used for more control, but most of the time a simple string will suffice.

You can see the output of running duvet on itself here.

Credits

This gem was created because I read this blog post on the AT&T engineering site by Aaron Patterson.

Copyright

Copyright (c) 2010-11 Joshua Hawxwell. See LICENSE for details.