diff options
author | danielsdeleo <dan@opscode.com> | 2013-05-27 11:15:01 -0700 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-05-29 11:32:22 -0700 |
commit | ca4cd1f830fae2fac3e2c18bbd2693b0caddcb33 (patch) | |
tree | 705a53ee2a2fd379096a8a15ebd6c070a7667639 /spec/functional/resource | |
parent | 00de51bb552ea2e613afec4825277b855775b71e (diff) | |
download | chef-ca4cd1f830fae2fac3e2c18bbd2693b0caddcb33.tar.gz |
Pass template extensions through to partials
- move the new TemplateContext code into mixin/template and consolidate
with ChefContext
- Copy extension modules from parent template to partial template.
- Functional tests for helpers with partials.
Diffstat (limited to 'spec/functional/resource')
-rw-r--r-- | spec/functional/resource/template_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/functional/resource/template_spec.rb b/spec/functional/resource/template_spec.rb index 4d8c6c8738..d966aefb6a 100644 --- a/spec/functional/resource/template_spec.rb +++ b/spec/functional/resource/template_spec.rb @@ -42,6 +42,11 @@ describe Chef::Resource::Template do resource = Chef::Resource::Template.new(path, run_context) resource.source('openldap_stuff.conf.erb') resource.cookbook('openldap') + + # TODO: partials rely on `cookbook_name` getting set by chef internals and + # ignore the user-set `cookbook` attribute. + resource.cookbook_name = "openldap" + resource end @@ -167,5 +172,15 @@ describe Chef::Resource::Template do it_behaves_like "a template with helpers" end + + context "using helpers with partial templates" do + before do + resource.source("helpers_via_partial_test.erb") + resource.helper(:helper_method) { "value from helper method" } + end + + it_behaves_like "a template with helpers" + + end end end |