-
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
allow skipping (unreachable) branch coverage only #1055
Comments
You can ignore that implicit branch like this: case match[2]
when "a"
...
when "b"
...
when "c"
...
else
:nocov:
nil
:nocov:
end |
Ok, thank you! Somehow not ideal but also I don't see any better way :) |
Yep, you also can actually cover that branch if you want 👍 |
What do you mean with cover? |
I mean you may write a unit test where that normally unreachable branch is tested (and it may contain something like |
I can't reach it because it will not match the |
Is syntax for skipping branch correct??
or am I missing something here? |
My bad, its
|
Any thoughts of allowing case match[2]
...
else
nil # :nocov:
end or even case match[2]
...
else nil # :nocov:
end This would be great to have because then there's not extra lines of code just to mark a case as unreachable. If interested, I could spend some time developing a patch for this. |
Hello, I would like to be able to skip some unreachable branches but I only see full coverage skipping with
nocov
.For example the following code will report the
else
is never run but it is unreachable:Is there another tag or can such be implemented that will only ignore branch coverage?
The text was updated successfully, but these errors were encountered: