A pretty safe way of applying resources in the tests is to use https://github.com/puppetlabs/puppet/blob/master/spec/lib/puppet_spec/compiler.rb#L21-L29 . It should produce a fully correct catalog and run the transaction as needed.