I can extract these things into Puppet::Util and testing for the whole class.

I just oriented myself as how it is done in other places. But you're right, this seems legitimate to extract that behavior so others can use it as well.