diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-20 15:22:57 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-20 15:23:14 -0700 |
commit | 7b3744cd363c817c515f865ccdf45bdfbdb5796b (patch) | |
tree | 0480a774a5a06dd2a79052a164f96829c7129200 /spec/unit/application/queue_spec.rb | |
parent | 220f3086e0254fb681a8dfece5238d0dff861f6f (diff) | |
download | puppet-7b3744cd363c817c515f865ccdf45bdfbdb5796b.tar.gz puppet-7b3744cd363c817c515f865ccdf45bdfbdb5796b.tar.xz puppet-7b3744cd363c817c515f865ccdf45bdfbdb5796b.zip |
maint: stop stubbing log level setting.
The underlying problem turned up when another test (as a side effect) changed
the logging level to be more verbose, and a very distant test broke. This
revealed that we didn't preserve that global state around tests.
Fixing that further revealed that we stubbed setting that log level all over
the place, as a point fix for the same problem, and to assert the operation of
various tools.
So, additionally, we strip out all that stubbing, and assert on the desired
effect rather than the mechanism for achieving it.
Reviewed-By: Max Martin <max@puppetlabs.com>
Diffstat (limited to 'spec/unit/application/queue_spec.rb')
-rwxr-xr-x | spec/unit/application/queue_spec.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/spec/unit/application/queue_spec.rb b/spec/unit/application/queue_spec.rb index 87713ca97..d71c879a9 100755 --- a/spec/unit/application/queue_spec.rb +++ b/spec/unit/application/queue_spec.rb @@ -10,7 +10,6 @@ describe Puppet::Application::Queue do @queue.stubs(:puts) @daemon = stub_everything 'daemon', :daemonize => nil Puppet::Util::Log.stubs(:newdestination) - Puppet::Util::Log.stubs(:level=) Puppet::Resource::Catalog.indirection.stubs(:terminus_class=) end @@ -113,18 +112,14 @@ describe Puppet::Application::Queue do it "should set log level to debug if --debug was passed" do @queue.options.stubs(:[]).with(:debug).returns(true) - - Puppet::Util::Log.expects(:level=).with(:debug) - @queue.setup_logs + Puppet::Util::Log.level.should == :debug end it "should set log level to info if --verbose was passed" do @queue.options.stubs(:[]).with(:verbose).returns(true) - - Puppet::Util::Log.expects(:level=).with(:info) - @queue.setup_logs + Puppet::Util::Log.level.should == :info end [:verbose, :debug].each do |level| |