(#20548) Allow an array of resource titles to be passed into the ensure_...#152
Conversation
…re_resource function This patch allows an array of resource titles to be passed into the ensure_resource function. Each item in the array will be checked for existence and will be created if it doesn't already exist.
There was a problem hiding this comment.
This was in the original implementation, but do you know why this is being done? Is this necessary?
There was a problem hiding this comment.
I'm not sure why it's being done, but if there is a better way of doing it, I'd be happy to refactor it.
There was a problem hiding this comment.
Each one of these expectations should be in a separate it block; this helps isolate test behavior. I've created a branch that provides an example of how this should be done, at https://github.com/adrienthebo/puppetlabs-stdlib/tree/maint-refactor_ensure_resource_expectations
This splits out the ensure_resource expectations into separate blocks for clarity. Per adrienthebo's recommendation.
There was a problem hiding this comment.
Another slick way to do this is: title = [title].flatten
…_ensure_resource (#20548) Allow an array of resource titles to be passed into the ensure_...
|
summary: merged into master in 3e59bbd. Thanks again for the contribution! |
...resource function
This patch allows an array of resource titles to be passed into
the ensure_resource function. Each item in the array will be
checked for existence and will be created if it doesn't already
exist.
This is associated with feature request #20548