crowbar/barclamp-crowbar — pull request #320 by jamestyj (2013-01-04 15:08:59+00:00)
Title: [Ruby 1.9] Add SimpleCov for test code coverage

Rcov only works for Ruby 1.8, while SimpleCov only works for Ruby 1.9.
So during the transition phase where both Ruby versions are supported,
we need to require and activate the appropriate one.

SimpleCov outputs the HTML report to RAILS_ROOT/coverage. One way to
easily view the report from your workstation/laptop (assuming your
Crowbar dev system is somewhere else) is to run:

````
cd RAILS_ROOT/public
ln -s ../coverage && ln -s coverage/assets
rails s puma
````

You can then view the report at http://192.168.124.10:3000/coverage.

Note that there's a minor bug in SimpleCov that triggers 404s for some
background images. This is harmless, but can be worked around with:

````
cd RAILS_ROOT/coverage/assets/0.7.1
ln -s smoothness/images
````