summaryrefslogtreecommitdiffstats
path: root/spec/unit/application/puppetd.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/application/puppetd.rb')
-rwxr-xr-xspec/unit/application/puppetd.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/unit/application/puppetd.rb b/spec/unit/application/puppetd.rb
index 08f2a070a..18caa9e86 100755
--- a/spec/unit/application/puppetd.rb
+++ b/spec/unit/application/puppetd.rb
@@ -76,6 +76,15 @@ describe "puppetd" do
end
describe "when handling options" do
+ before do
+ @old_argv = ARGV.dup
+ ARGV.clear
+ end
+
+ after do
+ ARGV.clear
+ @old_argv.each { |a| ARGV << a }
+ end
[:centrallogging, :disable, :enable, :debug, :fqdn, :test, :verbose].each do |option|
it "should declare handle_#{option} method" do
@@ -130,6 +139,14 @@ describe "puppetd" do
@puppetd.handle_logdest("console")
end
+ it "should parse the log destination from ARGV" do
+ ARGV << "--logdest" << "/my/file"
+
+ Puppet::Util::Log.expects(:newdestination).with("/my/file")
+
+ @puppetd.parse_options
+ end
+
it "should store the waitforcert options with --waitforcert" do
@puppetd.options.expects(:[]=).with(:waitforcert,42)