浏览 1727 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-03-21
#这里写你要包含的目录 RCOV_APPS_FILES = [/app[\/\\][^\.]+\.rb/] require 'rcov' class Rcov::CodeCoverageAnalyzer alias_method(:old_dump_coverage_info, :dump_coverage_info) unless method_defined?(:old_dump_coverage_info) def dump_coverage_info(formatters) all_files = [] require 'find' Find.find(RAILS_ROOT) do |path| Find.prune if path.index(".svn") || path.index(".cvs") RCOV_APPS_FILES.each do |r| if path =~ r all_files << path break end end end all_files.each do |file| formatters.each do |formatter| lines = File.read(file).split("\n") coverage = lines.collect{|i| false} counts = coverage.collect{|i| 0} formatter.add_file(file, lines, coverage, counts) end end old_dump_coverage_info(formatters) end end 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |