summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorDavid Schmitt <david@dasz.at>2010-04-29 17:32:40 +0200
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commite119b04f7738f5ffb6b9bf353bb28b3d058302a5 (patch)
treef711cd2bc6033f374f28b17b366865bd6d036c3e /spec/unit
parentd40e6d4bb6d899000b34422950412e90fb1d69dd (diff)
downloadpuppet-e119b04f7738f5ffb6b9bf353bb28b3d058302a5.tar.gz
puppet-e119b04f7738f5ffb6b9bf353bb28b3d058302a5.tar.xz
puppet-e119b04f7738f5ffb6b9bf353bb28b3d058302a5.zip
Avoid setting the timeout before we know which timeout we should set.
Signed-off-by: David Schmitt <david@dasz.at>
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/util/settings.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/unit/util/settings.rb b/spec/unit/util/settings.rb
index 24bd04b27..bf0776fc8 100755
--- a/spec/unit/util/settings.rb
+++ b/spec/unit/util/settings.rb
@@ -512,6 +512,26 @@ describe Puppet::Util::Settings do
@settings.parse
@settings[:myarg].should == ""
end
+
+ describe "and when reading a non-positive filetimeout value from the config file" do
+ before do
+ @settings.setdefaults :foo, :filetimeout => [5, "eh"]
+
+ somefile = "/some/file"
+ text = "[main]
+ filetimeout = -1
+ "
+ File.expects(:read).with(somefile).returns(text)
+ @settings[:config] = somefile
+ end
+
+ it "should not set a timer" do
+ EventLoop::Timer.expects(:new).never
+
+ @settings.parse
+ puts "2", @settings[:filetimeout]
+ end
+ end
end
describe "when reparsing its configuration" do