summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/util/settings.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/util/settings.rb b/spec/unit/util/settings.rb
index 6f92fae46..0bf2dbb19 100755
--- a/spec/unit/util/settings.rb
+++ b/spec/unit/util/settings.rb
@@ -90,6 +90,20 @@ describe Puppet::Util::Settings do
@settings[:bool].should == true
end
+ it "should consider a cli setting with no argument to be a boolean" do
+ # Turn it off first
+ @settings[:bool] = false
+ @settings.handlearg("--bool")
+ @settings[:bool].should == true
+ end
+
+ it "should consider a cli setting with an empty string as an argument to be a boolean" do
+ # Turn it off first
+ @settings[:bool] = false
+ @settings.handlearg("--bool", "")
+ @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"