summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-24 23:16:47 -0600
committerLuke Kanies <luke@madstop.com>2007-11-24 23:16:47 -0600
commitb575d1585322709604f558742dfd6f5ce412b342 (patch)
tree34e8049bf27383cb19ea23edf4d7d2a870eb7b48 /spec/unit
parent3fb8e2e3097c0a9ef0c534a9c96fe02b43b5e38c (diff)
downloadpuppet-b575d1585322709604f558742dfd6f5ce412b342.tar.gz
puppet-b575d1585322709604f558742dfd6f5ce412b342.tar.xz
puppet-b575d1585322709604f558742dfd6f5ce412b342.zip
Integrating Matt Palmer's patch to provide a 'plugins'
mount, fixing #891. The patch was ported to the current code by David Schmitt, I applied the rest of Matt's patches, and I then fixed all of the code so that the tests passed. The primary change I had to make to the patch was reenabling host expansion in paths -- his patch had disabled it.
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/util/settings.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/util/settings.rb b/spec/unit/util/settings.rb
index 620c04009..02800933c 100755
--- a/spec/unit/util/settings.rb
+++ b/spec/unit/util/settings.rb
@@ -102,6 +102,19 @@ describe Puppet::Util::Settings, " when setting values" do
values.should == %w{something}
end
+ it "should provide an option to call passed blocks during definition" do
+ values = []
+ @settings.setdefaults(:section, :hooker => {:default => "yay", :desc => "boo", :call_on_define => true, :hook => lambda { |v| values << v }})
+ values.should == %w{yay}
+ end
+
+ it "should pass the fully interpolated value to the hook when called on definition" do
+ values = []
+ @settings.setdefaults(:section, :one => ["test", "a"])
+ @settings.setdefaults(:section, :hooker => {:default => "$one/yay", :desc => "boo", :call_on_define => true, :hook => lambda { |v| values << v }})
+ values.should == %w{test/yay}
+ end
+
it "should munge values using the element-specific methods" do
@settings[:bool] = "false"
@settings[:bool].should == false