We've got some utility functions in ks testutils to handle this:

https://github.com/puppetlabs/clj-kitchensink/blob/master/test/puppetlabs/kitchensink/testutils.clj#L32