I hadn't thought about doing Array(), but that breaks if you pass a hash so I made it a little more complicated.  I'm not aware of a way to raise a PuppetError from an ERB, but the else that's in there should likely do that if possible.  Additional spec test added as well.