114
114
expect { @master.setup }.to raise_error(Puppet::Error, /Puppet master is not supported on Microsoft Windows/)
117
it "should set log level to debug if --debug was passed" do
118
@master.options.stubs(:[]).with(:debug).returns(true)
120
Puppet::Log.level.should == :debug
123
it "should set log level to info if --verbose was passed" do
124
@master.options.stubs(:[]).with(:verbose).returns(true)
126
Puppet::Log.level.should == :info
129
it "should set console as the log destination if no --logdest and --daemonize" do
130
@master.stubs(:[]).with(:daemonize).returns(:false)
132
Puppet::Log.expects(:newdestination).with(:syslog)
137
it "should set syslog as the log destination if no --logdest and not --daemonize" do
138
Puppet::Log.expects(:newdestination).with(:syslog)
143
it "should set syslog as the log destination if --rack" do
144
@master.options.stubs(:[]).with(:rack).returns(:true)
146
Puppet::Log.expects(:newdestination).with(:syslog)
117
describe "setting up logging" do
118
it "sets the log level" do
119
@master.expects(:set_log_level)
123
describe "when the log destination is not explicitly configured" do
125
@master.options.stubs(:[]).with(:setdest).returns false
128
it "logs to the console when --compile is given" do
129
@master.options.stubs(:[]).with(:node).returns "default"
130
Puppet::Util::Log.expects(:newdestination).with(:console)
134
it "logs to the console when the master is not daemonized or run with rack" do
135
Puppet::Util::Log.expects(:newdestination).with(:console)
136
Puppet[:daemonize] = false
137
@master.options.stubs(:[]).with(:rack).returns(false)
141
it "logs to syslog when the master is daemonized" do
142
Puppet::Util::Log.expects(:newdestination).with(:console).never
143
Puppet::Util::Log.expects(:newdestination).with(:syslog)
144
Puppet[:daemonize] = true
145
@master.options.stubs(:[]).with(:rack).returns(false)
149
it "logs to syslog when the master is run with rack" do
150
Puppet::Util::Log.expects(:newdestination).with(:console).never
151
Puppet::Util::Log.expects(:newdestination).with(:syslog)
152
Puppet[:daemonize] = false
153
@master.options.stubs(:[]).with(:rack).returns(true)
151
159
it "should print puppet config if asked to in Puppet config" do