rodjek/puppet-lint — pull request #368 by jonnangle (2014-11-26 20:03:02+00:00)
Title: Nested cases

Previously, it was possible to miss case statements without a default case when there were nested case statements in the mix. This came up when I was answering this question on ask.puppetlabs.com:

http://ask.puppetlabs.com/question/14669/puppet-rspec-fails-when-testing-against-none-standard-type/

I was planning to suggest running puppet-lint to catch the error, but when I tried it didn't seem to be working - it didn't notice the case statement without a default, because there was another case statement enclosed that did have one.

This commit fixes that problem by ensuring that default cases are matched up with their owning case statement, and not with any other case statements that might exist within the scope.