-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to add /app/views/* to coverage reports #345
Comments
Does #340 help? |
Thank you for the reply. #340 does help. I did comment on that post though with a couple clarifying questions. |
So, tl;dr SimpleCov will only report ruby files that are loaded (in your app) between when SimpleCov.start executes and the process ends. Adding a group only generates a new tab / presentation of the data. Template files such as erb or haml aren't 'Ruby' files, or at least aren't loaded in a way that Coverage tracks them. After your SimpleCov.start try adding SimpleCov.at_exit do
puts Coverage.result.keys
end Which will output every single file the Ruby stlib Coverage module recorded as being loaded. You'll likely notice your views aren't in that list. |
Thank you for the reply. I have found a similar response elsewhere (StackOverflow), but wanted to wait until an official moderator of the repo responded. |
link? |
This post links to others that I've seen as well... |
Ok, thanks. I should add some examples of this not working to the codebase :) |
Below is our
spec_helper.rb
file. I found how to add filters/groups on About.com. We decided to kill Spork when running the entire test suite, so coverage reports generate for each run. (We keep Spork on for testing individual pages, for speed's sake.)We decided to use SimpleCov because its documentation says it reports on MVC, while (before I found the About article) it only reported M&C. After adding the group, The report yields 100% on Views. Lib, and Plugins (latter 2 I did not have before), with zero files listed.
Will adding Views to the coverage report raise our percentage? If so, how can I correctly include the directory? If not, what could I do to raise the %covered to a more realistic value?
52% covered
ruby 1.9.2
rails 3.1.10
simplecov 0.7.1
The text was updated successfully, but these errors were encountered: