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
(WIP) (CONT-333) Ensure get_title_tokens func only gets resource titles
Prior to this commit, the get_title_tokens function searched all tokens to find a :COLON token. It then assumed that the tokens preceding this were the title definition of a resource. This resulted in undesirable behaviour as it would not work if e.g. a case statement was found; no title would be found. Furthermore, titles of known puppet resources is all that this function should be grabbing, instead of anything preceding a :COLON. Therefore, it is a more robust approach to first find a resource definition, like an exec, and then look for a title declaration following this. This is what this commit attempts to achieve.
get_title_tokens is now get_exec_titles which now only gets exec titles and therefore does not return the resource type. Since only an array of tokens is returned now, get_exec_titles returns an array instead of a hash of arrays.
Adding spec test to unsure problems encountered with case statements is avoided in future.
0 commit comments