Installing RCov by script

Code coverage analysis with RCov, next on my TODO :>
Another install script for your leisure…

OBSOLETE: gem install rcov works again!

tar -xf rcov-
sudo ruby rcov-
rm -rf rcov-

svn cleanup
svn update
piston import vendor/plugins/rails_rcov

Now you can get started with rake test:units:rcov

Unit test results

  • Show only selected parts: SHOW_ONLY=m,l,c,v //model,lib,controller,view
  • Run single tests: rcov FILE -exclude “/var/|/usr/” –rails (irgnore /var and /usr folder)
  • Add RCov parameters: RCOV_PARAMS=””
  • exclude RCOV_PARAM=”–exclude ‘var/*,gems/*'”
  • Sort by coverage: COV_PARAMS=”–sort=coverage”
  • Hide fully covered: RCOV_PARAMS=” –only-uncovered”
  • If you see something like (eval):580:in `attribute’: wrong number of arguments (2 for 0) (ArgumentError) it means one of your tests is uncoverable, this can happen while using SQS gem

Add the RCOV_PARAMS to spec/rcov.opts (or test/rcov.opts)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s