diff options
author | Andrea Campi <andrea.campi@zephirworks.com> | 2012-11-18 23:38:18 +0100 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2012-12-14 11:10:28 -0800 |
commit | b8cd17a7e9a2f5e9738400b96df478bab093c7e7 (patch) | |
tree | 0ef1686aab19958765ef0242088b74eb9675880d /spec | |
parent | 77dda3749fb48f0ac4ee3693e21ca0b453c0bbd1 (diff) | |
download | chef-b8cd17a7e9a2f5e9738400b96df478bab093c7e7.tar.gz |
[CHEF-3249] Accept an optional 'source' option to override the actual path to the partial.
This is mostly for uniformity with the template resource.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/mixin/template_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/mixin/template_spec.rb b/spec/unit/mixin/template_spec.rb index a926b1c494..4b8bcb219f 100644 --- a/spec/unit/mixin/template_spec.rb +++ b/spec/unit/mixin/template_spec.rb @@ -100,6 +100,20 @@ describe Chef::Mixin::Template, "render_template" do end end + it "should render using the source argument if provided" do + begin + tf = Tempfile.new("partial") + tf.puts "test" + tf.rewind + + @provider.render_template("before {<%= render 'something', :local => true, :source => '#{tf.path}' %>} after", @template_context) do |tmp| + tmp.open.read.should == "before {test\n} after" + end + ensure + tf.close + end + end + it "should pass the node to partials" do @node.normal[:slappiness] = "happiness" |