diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-06-28 13:55:50 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-07-10 10:57:38 +1000 |
commit | d152c5e358cad1241ce6cdcc302c1b2f3175f480 (patch) | |
tree | b69aeffe56d1891df19cbb033ce7a92a0bc0972e /spec | |
parent | 911b490f2288f81b36d484b40dd3d875320cf624 (diff) | |
download | puppet-d152c5e358cad1241ce6cdcc302c1b2f3175f480.tar.gz puppet-d152c5e358cad1241ce6cdcc302c1b2f3175f480.tar.xz puppet-d152c5e358cad1241ce6cdcc302c1b2f3175f480.zip |
Allow boolean value for boolean cli parameter
This is to fix puppetdoc boolean parameters.
Puppetdoc defers sending parameters to Puppet::Util::Setting, and
in this case, boolean parameters are stored as a boolean value.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/util/settings.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/util/settings.rb b/spec/unit/util/settings.rb index c700c0c5f..5e9ab3a18 100755 --- a/spec/unit/util/settings.rb +++ b/spec/unit/util/settings.rb @@ -104,6 +104,13 @@ describe Puppet::Util::Settings do @settings[:bool].should == true end + it "should consider a cli setting with a boolean as an argument to be a boolean" do + # Turn it off first + @settings[:bool] = false + @settings.handlearg("--bool", true) + @settings[:bool].should == true + end + it "should clear the cache when setting getopt-specific values" do @settings.setdefaults :mysection, :one => ["whah", "yay"], :two => ["$one yay", "bah"] @settings[:two].should == "whah yay" |