There were some warnings and stack traces in the spec output that aren't
necessary.

The only interesting fix is of the message:

lib/puppet/module.rb:79 warning: multiple values for a block parameter (0 for 1)
   from lib/puppet/util/logging.rb:30

If you call any form of logging on a module you end calling the file
method on the module just because logging always checks for that method
and calls it if it's defined, but in this case it's not defined in the
way that logging expected so passes the wrong paramters.

The easy solution is just to call logging on Puppet, which makes sense
in this case anyway, and I don't think it's worth a separate ticket to
deal with that logging warning.

Reviewed-by: Nick Lewis <[email protected]>
Signed-off-by: Matt Robinson <[email protected]>
---
 lib/puppet/module.rb                         |    2 +-
 spec/unit/indirector/queue_spec.rb           |    3 +++
 spec/unit/module_spec.rb                     |    4 ++--
 spec/unit/network/handler/fileserver_spec.rb |    2 +-
 spec/unit/parser/parser_spec.rb              |    2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb
index 8da19c2..43266b2 100644
--- a/lib/puppet/module.rb
+++ b/lib/puppet/module.rb
@@ -191,7 +191,7 @@ class Puppet::Module
 
   def backward_compatible_plugins_dir
     if dir = File.join(path, "plugins") and FileTest.exist?(dir)
-      warning "using the deprecated 'plugins' directory for ruby extensions; 
please move to 'lib'"
+      Puppet.warning "using the deprecated 'plugins' directory for ruby 
extensions; please move to 'lib'"
       return dir
     else
       return File.join(path, "lib")
diff --git a/spec/unit/indirector/queue_spec.rb 
b/spec/unit/indirector/queue_spec.rb
index 00463ee..bbe00c7 100755
--- a/spec/unit/indirector/queue_spec.rb
+++ b/spec/unit/indirector/queue_spec.rb
@@ -114,6 +114,9 @@ describe Puppet::Indirector::Queue, :if => 
Puppet.features.pson? do
       @store_class.client.expects(:subscribe).yields("foo")
       @store_class.expects(:intern).raises ArgumentError
       Puppet.expects(:err)
+
+      @store_class.expects(:puts)
+
       @store_class.subscribe {|o| o }
     end
   end
diff --git a/spec/unit/module_spec.rb b/spec/unit/module_spec.rb
index 37dad7e..0b4873f 100755
--- a/spec/unit/module_spec.rb
+++ b/spec/unit/module_spec.rb
@@ -367,9 +367,9 @@ describe Puppet::Module do
     mod.stubs(:path).returns "/a/foo"
     FileTest.expects(:exist?).with("/a/foo/plugins").returns true
 
-    mod.expects(:warning)
-
     mod.plugin_directory.should == "/a/foo/plugins"
+    @logs.first.message.should == "using the deprecated 'plugins' directory 
for ruby extensions; please move to 'lib'"
+    @logs.first.level.should == :warning
   end
 
   it "should default to 'lib' for the plugins directory" do
diff --git a/spec/unit/network/handler/fileserver_spec.rb 
b/spec/unit/network/handler/fileserver_spec.rb
index b37d4f5..9d34e9c 100644
--- a/spec/unit/network/handler/fileserver_spec.rb
+++ b/spec/unit/network/handler/fileserver_spec.rb
@@ -158,7 +158,7 @@ describe Puppet::Network::Handler::FileServer do
     end
 
     it "should not fail for inexistant plugins type" do
-      lambda { @mount.list("puppet/parser",true,false) }.should_not raise_error
+      @mount.list("puppet/parser",true,false)
     end
 
   end
diff --git a/spec/unit/parser/parser_spec.rb b/spec/unit/parser/parser_spec.rb
index 6cc393d..2ed279f 100755
--- a/spec/unit/parser/parser_spec.rb
+++ b/spec/unit/parser/parser_spec.rb
@@ -259,7 +259,7 @@ describe Puppet::Parser do
     before do
       @lexer = stub 'lexer', :line => 50, :file => "/foo/bar", :getcomment => 
"whev"
       @parser.stubs(:lexer).returns @lexer
-      @class = stub 'class', :use_docs => false
+      @class = Puppet::Resource::Type.new(:hostclass, "myclass", :use_docs => 
false)
     end
 
     it "should return a new instance of the provided class created with the 
provided options" do
-- 
1.7.3.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to