diff options
Diffstat (limited to 'spec/unit')
| -rwxr-xr-x | spec/unit/util/log_spec.rb | 19 | ||||
| -rwxr-xr-x | spec/unit/util/logging_spec.rb | 1 |
2 files changed, 5 insertions, 15 deletions
diff --git a/spec/unit/util/log_spec.rb b/spec/unit/util/log_spec.rb index df3c36ff2..e188a2366 100755 --- a/spec/unit/util/log_spec.rb +++ b/spec/unit/util/log_spec.rb @@ -6,22 +6,11 @@ require 'puppet/util/log' describe Puppet::Util::Log do it "should write a given message to the specified destination" do - Puppet::Util::Log.newdestination(:array) + arraydest = [] + Puppet::Util::Log.newdestination(arraydest) Puppet::Util::Log.new(:level => :notice, :message => "foo") - message = Puppet::Util::Log.destinations[:array].messages.shift.message + message = arraydest.last.message message.should == "foo" - - Puppet::Util::Log.close_all - end - - it "should be able to close all log destinations" do - destinations = stub_everything('destinations') - destinations.stubs(:keys).returns %w{foo bar} - Puppet::Util::Log.expects(:destinations).returns(destinations) - Puppet::Util::Log.expects(:close).with("foo") - Puppet::Util::Log.expects(:close).with("bar") - - Puppet::Util::Log.close_all end describe Puppet::Util::Log::DestConsole do @@ -96,9 +85,9 @@ describe Puppet::Util::Log do end it "should flush the log queue when the first destination is specified" do + Puppet::Util::Log.close_all Puppet::Util::Log.expects(:flushqueue) Puppet::Util::Log.newdestination(:array) - Puppet::Util::Log.close_all end it "should convert the level to a symbol if it's passed in as a string" do diff --git a/spec/unit/util/logging_spec.rb b/spec/unit/util/logging_spec.rb index 41b07d433..62a66fc92 100755 --- a/spec/unit/util/logging_spec.rb +++ b/spec/unit/util/logging_spec.rb @@ -41,6 +41,7 @@ describe Puppet::Util::Logging do end it "should queue logs sent without a specified destination" do + Puppet::Util::Log.close_all Puppet::Util::Log.expects(:queuemessage) @logger.notice "foo" |
