diff options
| author | Henrik Lindberg <henrik.lindberg@cloudsmith.com> | 2014-03-08 11:56:57 -0800 |
|---|---|---|
| committer | Henrik Lindberg <henrik.lindberg@cloudsmith.com> | 2014-03-08 11:56:57 -0800 |
| commit | edd3e8ea5e1ce0d95c3d7eb25a53259b41e1e975 (patch) | |
| tree | 6ae0fb723a7399926b4c344ab520a685d8c6452b /spec/unit/parser/functions/inline_epp_spec.rb | |
| parent | b3f8cb024fb906c76a622115b0d8dea8cd249b57 (diff) | |
| download | puppet-edd3e8ea5e1ce0d95c3d7eb25a53259b41e1e975.tar.gz | |
(PUP-1897) Allow EPP render expression to render a block
If a block is given in <%= {} %> the block should be evaluated, and
what it produces should be rendered. This commit makes this possible
by:
* explicitly handle the render block case
* allowing {} to be validated as r-value producing
Diffstat (limited to 'spec/unit/parser/functions/inline_epp_spec.rb')
| -rw-r--r-- | spec/unit/parser/functions/inline_epp_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/unit/parser/functions/inline_epp_spec.rb b/spec/unit/parser/functions/inline_epp_spec.rb index bbd7e8a33..44b24528b 100644 --- a/spec/unit/parser/functions/inline_epp_spec.rb +++ b/spec/unit/parser/functions/inline_epp_spec.rb @@ -56,6 +56,10 @@ describe "the inline_epp function" do end end + it "renders a block expression" do + eval_template_with_args("<%= {($x) $x + 1} %>", 'x' => 2).should == "3" + end + # although never a problem with epp it "is not interfered with by having a variable named 'string' (#14093)" do scope['string'] = "this output should not be seen" |
