When you run rake spec:rcov for a Rails 3 application, the files in the spec/ directory fall into the coverage statistics, but I donβt want them to be. I want coverage statistics only for my actual application.
In older versions of RSpec, it was possible to configure this using the spec/rcov.opts with the --exclude "spec/*" , but it seems that the file is no longer readable by Rspec 2. I tried to create the .rcov file, since spec/spec.opts changed to .rspec , but that didn't work either.
I found some documentation on how to do this when defining the rake task, but I would prefer not to overwrite the rake command provided - it seems like this should be what other people tried to do as well.
How to configure files excluded from coverage statistics?
For reference, the versions of all the relevant gems that I use are as follows:
rails (3.0.5) rake (0.8.7) rcov (0.9.9) rspec (2.5.0,) rspec-core (2.5.1) rspec-expectations (2.5.0,) rspec-mocks (2.5.0) rspec-rails (2.5.0)
Emily source share