rodjek/rspec-puppet — pull request #49 by hunner (2012-09-19 17:34:00+00:00)
Title: Exported resources specs

This pull request allows rspec-puppet module spec tests to be written for classes which contain the exported resource collector <<| |>> by defining let(:exported_resources) arrays of resource hashes. It builds off of @rodjek's previous work, with some modifications to remove monkey-patching and work around rspec bugs.

This currently implements exporting resources for importing. It does not have the ability to check that resources were exported by the catalogue compile because the temporary db is wiped after each test case (but rspec-puppet caches the catalogue instead of compiling for each test case).

There is currently no way to inject virtual resources into a catalogue compile, so this functionality has not been carried on from the original commit by @rodjek.

This change is backwards compatible. Adds 14 tests and all tests pass.