[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5
Daniel Pittman
daniel at rimspace.net
Tue May 10 08:05:46 UTC 2011
The following commit has been merged in the experimental branch:
commit 93082e4a683d417603aeb3bffb73b45d007315a7
Author: Daniel Pittman <daniel at rimspace.net>
Date: Thu Mar 3 10:56:00 2011 -0800
(#6582) unstub Puppet settings to improve indirector queue tests.
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 <nick at puppetlabs.com>
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
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list