简单的 cov gem 在 Rails 中缺少未经测试的文件 [英] Simple cov gem missing untested files in Rails

查看:35
本文介绍了简单的 cov gem 在 Rails 中缺少未经测试的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Rails 应用中使用 simple_cov gem,我们可以将未测试的文件包含在报告中吗?

Using simple_cov gem in a Rails app, can we have the files that we are not testing included in the report?

  • 如果是,怎么做?

  • If yes, how?

如果不是,这些文件应该算到覆盖率中,对吗?

If no, that files should count to the coverage percentage, right ?

推荐答案

尝试编辑您的 config/environments/test.rb 并设置这一行:

Try to edit your config/environments/test.rb and set this line:

config.eager_load = false

true 以这种方式加载整个应用程序并 simplecov 读取它.

to true in this way the whole app is loaded and simplecov reads it.

这篇关于简单的 cov gem 在 Rails 中缺少未经测试的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆