Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show missed else branch of case statements even if not declared
I "flip flopped" a lot on this, the initial PR had it implemented as omitting this. You can make an argument either way. You can say your case statement already handles the entire range of input values given your domain. And then testing another value seems too much as it's not realistic (or caught elsewhere). However, who are we to hide additional branch coverage data from users? It's also more consistent as we also display the else branch for if statement without an else. I also think it might help show lapses in coverage. ```ruby var = case arg when "functional" 55 when "something" 42 end var += 1 ``` When we never hit a branch we get an error down there, it's something peple might reliably forget. On top of that it's actually more code to ignore it. So to summarize it why should we display the else branch for case statements even if we don't have them: * show all available coverage data * consistency with other constructs * actually less code
- Loading branch information