summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2010-07-07 10:30:15 -0700
committerNick Lewis <nick@puppetlabs.com>2010-07-07 11:51:54 -0700
commitcdd43825cee233af478d807cddda346e9d1fe142 (patch)
tree51f56c551f8364efa3053e404f04db568fa69943 /spec/unit
parente419293e58addfd8e4f0612ad121f68038daa14a (diff)
downloadpuppet-cdd43825cee233af478d807cddda346e9d1fe142.tar.gz
puppet-cdd43825cee233af478d807cddda346e9d1fe142.tar.xz
puppet-cdd43825cee233af478d807cddda346e9d1fe142.zip
[#4114] Fix failures in the unit tests
The initial commit changed the name of a method (close -> close_all) and changed the way the array log destination worked before we saw that the unit tests were using it differently.
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/util/log_spec.rb19
-rwxr-xr-xspec/unit/util/logging_spec.rb1
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"