summaryrefslogtreecommitdiff
path: root/spec/unit/mixin/template_spec.rb
diff options
context:
space:
mode:
authorAndrea Campi <andrea.campi@zephirworks.com>2012-11-18 23:44:00 +0100
committerBryan McLellan <btm@opscode.com>2012-12-14 11:10:28 -0800
commit4eb1b589f1d6c216be5788c501c4328a4967ba4b (patch)
treec703b1a2331cdf6df0b27dc16d30c0e7bdd8ee58 /spec/unit/mixin/template_spec.rb
parentb8cd17a7e9a2f5e9738400b96df478bab093c7e7 (diff)
downloadchef-4eb1b589f1d6c216be5788c501c4328a4967ba4b.tar.gz
[CHEF-3249] Fix nested partials; add a test for that.
Diffstat (limited to 'spec/unit/mixin/template_spec.rb')
-rw-r--r--spec/unit/mixin/template_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/mixin/template_spec.rb b/spec/unit/mixin/template_spec.rb
index 4b8bcb219f..f5e5181a62 100644
--- a/spec/unit/mixin/template_spec.rb
+++ b/spec/unit/mixin/template_spec.rb
@@ -153,6 +153,14 @@ describe Chef::Mixin::Template, "render_template" do
tmp.open.read.should == "before {super secret is } after"
end
end
+
+ it "should render nested partials" do
+ path = File.expand_path(File.join(CHEF_SPEC_DATA, "partial_one.erb"))
+
+ @provider.render_template("before {<%= render '#{path}', :local => true %>} after", @template_context) do |tmp|
+ tmp.open.read.should == "before {partial one We could be diving for pearls!\n calling home\n} after"
+ end
+ end
end
describe "when an exception is raised in the template" do