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
{{ message }}
Repository navigation
Multi-line statements not being counted accurately #394
I'm using 0.10 on a Rails 4.2 project with ruby 2.0.0-p643. I'm seeing lots of occurrences of statements that span multiple lines not being counted as covered, or only 1 or the multiple lines being counted. For example, I have a concern which is completely tested but reports as 77%.
If I simply reformat the code onto single lines I get 100% coverage.
Activity
bf4 commentedon Jun 11, 2015
so that we can reproduce this, can you provide a small snippet of the code and tests that create this bug? It would be of great help.
adampope commentedon Jun 18, 2015
@bf4 I've created a repo with the code to reproduce this in (https://github.com/adampope/simplecov-multi-line-repro). In doing so I've found the cause. We are using the following snippet in
test_helper.rb(from #16) to make sure that all files are loaded:With that code multi-line statements do not get counted correctly.
With
Without
Any ideas on ways to modify this to correctly handle the multi-line statements?
adampope commentedon Jun 18, 2015
We found a better way of solving the problem of tracking all files, I've added a comment to #16 so I'll close this ticket.
mudit-1996 commentedon May 19, 2018
@bf4 @adampope Hey. What is the final fix for multi line statements. Please help.