From: Daniel Pittman <[email protected]>

This code was stubbing Puppet settings, which is no longer required now we
reset them between tests.  Using the real thing reduces points that the rest
of the code can break, too.

As a side effect this caused Puppet[:trace] to be "true", which meant that we
emitted a huge, nasty backtrace during the testing of a specific internal
failure handling case.

Reviewed-By: Nick Lewis <[email protected]>
---
 spec/unit/indirector/queue_spec.rb |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/spec/unit/indirector/queue_spec.rb 
b/spec/unit/indirector/queue_spec.rb
index 7732e41..49e5e10 100755
--- a/spec/unit/indirector/queue_spec.rb
+++ b/spec/unit/indirector/queue_spec.rb
@@ -42,8 +42,7 @@ describe Puppet::Indirector::Queue, :if => 
Puppet.features.pson? do
     @subject = @subject_class.new
     @subject.name = :me
 
-    Puppet.settings.stubs(:value).returns("bogus setting data")
-    Puppet.settings.stubs(:value).with(:queue_type).returns(:test_client)
+    Puppet[:queue_type] = :test_client
     
Puppet::Util::Queue.stubs(:queue_type_to_class).with(:test_client).returns(Puppet::Indirector::Queue::TestClient)
 
     @request = stub 'request', :key => :me, :instance => @subject
@@ -112,9 +111,12 @@ describe Puppet::Indirector::Queue, :if => 
Puppet.features.pson? do
 
     it "should log but not propagate errors" do
       @store_class.client.expects(:subscribe).yields("foo")
-      @store_class.expects(:intern).raises ArgumentError
-      Puppet.expects(:err)
-      @store_class.subscribe {|o| o }
+      @store_class.expects(:intern).raises(ArgumentError)
+      expect { @store_class.subscribe {|o| o } }.should_not raise_error
+
+      @logs.length.should == 1
+      @logs.first.message.should =~ /Error occured with subscription to queue 
my_queue for indirection my_queue: ArgumentError/
+      @logs.first.level.should == :err
     end
   end
 end
-- 
1.7.4.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