You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# my_engine/spec/spec_helper.rb:
SimpleCov.start 'rails' do
adapters.delete(:root_filter)
filters.clear # This will remove the :root_filter that comes via simplecov's defaults
add_filter do |src|
!(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /my_engine/
end
end
However, instead of catching the code in both lib and the app directories of the engine, it instead only captures a few spec files:
Engines are tested in context of a spec/dummy app.
Sanity check, did you actually use /my_engine/? Also, normally you would test coverage of spec files. That might be useful in seeing if you have unexecuted tests, but that's about it.
For sanity check, please also try what I suggested in #345 (comment)
After your SimpleCov.start try adding
SimpleCov.at_exitdoputsCoverage.result.keysend
Which will output every single file the Ruby stlib Coverage module recorded as being loaded. Hopefully that will help you pinpoint your problem.
I have an engine repo much like mentioned in #221, and like that issue, I am not getting any coverage from my specs:
I attempted to use the solution suggested in the https://gist.github.com/bsodmike/5866873:
However, instead of catching the code in both lib and the app directories of the engine, it instead only captures a few
spec
files:Engines are tested in context of a
spec/dummy
app.The text was updated successfully, but these errors were encountered: