Ruby test coverage tool

眉间皱痕 提交于 2020-01-02 00:16:09

问题


I need a tool which measures test coverage under Ruby.

I tried rcov, but couldn't install it under Windows, Cygwin, or Ubuntu.

Which programs (not necessarily free) calculate the branch and/or line coverage of tests in Ruby and work with Ruby on Rails?


回答1:


Simplecov. Rcov doesn't work so well under Ruby 1.9.*, but simplecov does.




回答2:


You also have deep-cover which aims to be more complete than the mentioned examples.

From the Readme:

Deep Cover aims to be the best coverage tool for Ruby code:

more accurate line coverage

branch coverage

can be used as a drop-in replacement for the built-in Coverage library.




回答3:


Use Ruby's built in Coverage feature if you are wanting something very simple. It is what Simplecov uses under the hood.



来源:https://stackoverflow.com/questions/6639945/ruby-test-coverage-tool

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!