puppetlabs-operations/puppet-puppet — pull request #159 by danieldreier (2014-12-15 02:17:41+00:00)
Title: Refactor rspec-puppet tests

I've refactored the rspec-puppet tests because seeing PR https://github.com/puppetlabs-operations/puppet-puppet/pull/147 languish with good code and a very modestly broken test indicates to me that the current tests are too hard to understand. They were very heavily copy-pasted.

This is also the first production use of the [puppet_spec_facts](https://github.com/danieldreier/puppet_spec_facts) gem that I recently wrote; it contains facter fact hashes and allows you to iterate over them so that you don't have to have that logic and data making a mess of the spec file.

The nutshell version of the changes is replacing copy-paste duplication with iteration and variables. Glad to take a different approach or make changes to puppet_spec_facts if needed.