diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-07-11 20:40:53 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-07-11 20:40:53 +0000 |
| commit | 1ab45947dab40a99c331a5dc550dc00f54dc3180 (patch) | |
| tree | bd1a9bc223a1d44dbb2dfb5a92a894c8e8e0abc1 /test | |
| parent | a6cc3e473fd68bbb7493a81c14fa1a607d88a5a3 (diff) | |
Adding tests for previous config bugfixes, and updating changelog
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1391 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/other/config.rb | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/other/config.rb b/test/other/config.rb index 457010ac0..9f941af4e 100755 --- a/test/other/config.rb +++ b/test/other/config.rb @@ -646,6 +646,54 @@ inttest = 27 assert_equal("yayness", Puppet[:tags], "Tags got changed during config") end + + def test_configs_replace_in_url + config = mkconfig + + config.setdefaults(:mysection, :name => ["yayness", "yay"]) + config.setdefaults(:mysection, :url => ["http://$name/rahness", "yay"]) + + val = nil + assert_nothing_raised { + val = config[:url] + } + + assert_equal("http://yayness/rahness", val, + "Config got messed up") + end + + def test_correct_type_assumptions + config = mkconfig + + file = Puppet::Config::CFile + element = Puppet::Config::CElement + bool = Puppet::Config::CBoolean + + # We have to keep these ordered, unfortunately. + [ + ["/this/is/a/file", file], + ["true", bool], + [true, bool], + ["false", bool], + ["server", element], + ["http://$server/yay", element], + ["$server/yayness", file], + ["$server/yayness.conf", file] + ].each do |ary| + value, type = ary + elem = nil + assert_nothing_raised { + elem = config.newelement( + :name => value, + :default => value, + :section => :yayness + ) + } + + assert_instance_of(type, elem, + "%s got created as wrong type" % value.inspect) + end + end end # $Id$ |
