开发者

Why is RCov excluding views and including comments?

开发者 https://www.devze.com 2023-02-01 15:26 出处:网络
I am using Rails 3, RSpec 2 and the rcov gem. I am running rcov on my specs with the following rake task:

I am using Rails 3, RSpec 2 and the rcov gem. I am running rcov on my specs with the following rake task:

desc "Run all specs with rcov"
 RSpec::Core::RakeTask.new(:rcov => spec_prereq) do |t| 
  t.rcov = true 
  t.pattern = "./spec/**/*_spec.rb" 
  t.rcov_opts = %w{--rails --include views -Ispec --exclude gems\/,spec\/,features\/,seeds\/} 
end 

Firstly the view specs are not included in the results. How can I see code coverage for the views in the rcov results? Secondly, the code coverage for the models are quite low. When I look at the details it is because the comment lines are highlighted as not executed. How can I fix this? Lastly, it seems that most (if not all) of the method definitions are 开发者_运维百科marked as not executed. Is there a way to correct this? Thanks, Daryn


Are you sure rcov should work "as-is" with Rails3?

Are you doing anything to make it work - I see a couple of work-arounds on the web:

http://www.betaful.com/?p=498

https://github.com/nathanhumbert/rails_code_qa

Admittedly, I dont know RSpec and that perhaps has this covered in the way it wraps rcov...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号