summaryrefslogtreecommitdiffstats
path: root/test/puppet
diff options
context:
space:
mode:
authorlutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-09 00:48:28 +0000
committerlutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-09 00:48:28 +0000
commitebcb6b6df7af42632a6c1beaa1b60171ff32b61e (patch)
tree2d82562a541862f20daf9e05f1a3642a27e4ffb1 /test/puppet
parentba6257c02ef5e4bd32d58d40087f84dda95141c3 (diff)
downloadpuppet-ebcb6b6df7af42632a6c1beaa1b60171ff32b61e.tar.gz
puppet-ebcb6b6df7af42632a6c1beaa1b60171ff32b61e.tar.xz
puppet-ebcb6b6df7af42632a6c1beaa1b60171ff32b61e.zip
The template function now tries to first find a template within a module
(if the template path looks like it belongs to a module) and only when that fails looks for it in templatedir git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2277 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/puppet')
-rw-r--r--test/puppet/modules.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/puppet/modules.rb b/test/puppet/modules.rb
index f3cf3b73c..e652182a8 100644
--- a/test/puppet/modules.rb
+++ b/test/puppet/modules.rb
@@ -38,4 +38,21 @@ class TestModules < Test::Unit::TestCase
assert_equal("testmod", mod.name)
assert_equal(path, mod.path)
end
+
+ def test_find_template
+ templ = "testmod/templ.erb"
+ assert_equal(File::join(Puppet[:templatedir], templ),
+ Puppet::Module::find_template(templ))
+
+ templ_path = File::join(@varmods, "testmod",
+ Puppet::Module::TEMPLATES, "templ.erb")
+ FileUtils::mkdir_p(File::dirname(templ_path))
+ File::open(templ_path, "w") { |f| f.puts "Howdy" }
+
+ assert_equal(templ_path, Puppet::Module::find_template(templ))
+
+ mod = Puppet::Module::find(templ)
+ assert_not_nil(mod)
+ assert_equal(templ_path, mod.template(templ))
+ end
end