puppetlabs/puppet — pull request #1086 by jeffmccune (2012-08-29 23:51:12+00:00)
Title: (#15193) Fix StaticCompiler#store_content

Without this patch the static compiler's store_content method improperly
calls the indirector in a way that produces fatal exceptions preventing
catalog compilation.

These errors take the form of:

NoMethodError: undefined method `find' for
Puppet::FileServing::Content:Class

This patch fixes the problem by sending the messages to the right places
for Puppet 2.7.x and Puppet 3.x

This is a verbatim copy of Luke's patch in the ticket.

(#15193) Add spec test coverage for static compiler

Without this patch there is no test coverage for the static compiler
terminus. This is a problem because internal changes to the indirector
break the expected behavior of the static compiler and we have no
automated way to discover the broken behavior.

This patch adds spec test coverage for the static compiler's find method.
This covers the most common use case of the static compiler where by file
resources with source parameters are modified in the resource catalog.

The patch does not include test coverage for recursive file resources.

The approach taken stubs the underlying compiler terminus and produces a
fake resource catalog for the static compiler to operate on. The
fileserver metadata API is also mocked to break the dependency on a real
fileserver.