summaryrefslogtreecommitdiff
path: root/spec/unit/functions/epp_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2014-09-08(PUP-3190) Don't assume puppet is in a lib dirAndrew Parker1-1/+0
The loaders previously assumed that any installation of puppet would be under a directory called lib. This holds true when running puppet from source (during development), or in some package cases, but is not generally true. This simplifying assumption was made so that the loading path for both puppet system extensions (built in functions) and module extensions could be loaded in the same manner: find the root of the extender and loading code from `lib/puppet/...`. This changes to loading to instead only assume that there is a `puppet` directory and not the name of the parent. This, however, forces the loader for modules to become specialized to only be able to find ruby extentions, because they are in the 'lib' directory, which is how the loader must now be configured.
2014-07-14(PUP-2883) Allow empty body in epp templatesHenrik Lindberg1-0/+10
This allows an epp body to be empty by making grammar accept an empty list of statements. This avoids getting a cryptic error message about "syntax error at end of file" when using parameters, but having no body that produces output, or when having a completely empty template.
2014-06-30(PUP-480) Put the nail in :undef's coffinHenrik Lindberg1-1/+1
This changes the evaluation of a LiteralUndef to nil from :undef. As a consequence, there were minor adjustments needed to the Closure's call_by_name support to get the correct semantics for "missing" parameters. Tests are also added to ensure that :undef does not sneak into arrays or hashes in the 4x function API. This commit contains a cheat for epp and inline_epp functions as they need to receive their arguments without transformation. When that is fixed (PUP-2845) the cheat in runtime3_support#call_function() should be removed. :undef is still used in the "puppet/pops" section of the code (mainly for reasons of transforming to 3x, and if :undef symbols leak from 3x.)
2014-06-27(PUP-2845) Move the epp function to the 4x function API.Henrik Lindberg1-0/+145
This moves the epp function to the new function API. The type checking is much approved as a consequence as the function is now protected against spilling non variable name compliant variables into the scope.