Simplecov report ignores folders in /app directory

拟墨画扇 提交于 2019-12-07 14:47:43

问题


I use simplecov to measure coverage for my Rails 4.0.11 app. I use Ruby 2.0.0. I noticed that some subfolders of /app are ignored by simplecov and I can't figure out why.

test_helper.rb:
require 'simplecov'
SimpleCov.start 'rails'

ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)

I have tried upgrading to Ruby 2.1 after reading some posts that that might help, but still some subfolders are being ignored. I also tried to move the SimpleCov.start into a .simplecov file at the root of my project, but the problem persists. I also tried to remove the rails configuration and add filters and groups myself, but the ignored ones just turn up empty.

Folder like /mailers, /serializers, /presenters are all ignored. It does pick up on /models and /controllers.


回答1:


I had the same issue. in your rails environments/test.rb make config.eager_load = true. this will load every ruby files while app booting.



来源:https://stackoverflow.com/questions/29561242/simplecov-report-ignores-folders-in-app-directory

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