summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-24 23:17:57 -0600
committerLuke Kanies <luke@madstop.com>2007-11-24 23:17:57 -0600
commit4e9c39e6a7ca5ebb9d8343d1e6b835e24c257200 (patch)
tree431872a6909aab930d4585d1b4b4d730f4bfb703 /spec/unit
parent7eb09abebb91a567b081a651fce179acfadfb7c0 (diff)
parentb575d1585322709604f558742dfd6f5ce412b342 (diff)
downloadpuppet-4e9c39e6a7ca5ebb9d8343d1e6b835e24c257200.tar.gz
puppet-4e9c39e6a7ca5ebb9d8343d1e6b835e24c257200.tar.xz
puppet-4e9c39e6a7ca5ebb9d8343d1e6b835e24c257200.zip
Merge branch 'plugins_mount', fixing #891.
Conflicts: CHANGELOG
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 2856c574e..596c21c7d 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