summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-05-04 15:56:45 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-05-04 15:57:12 -0700
commit0aac15d09c2c045f96bf9c2aec48b0f378b5f95a (patch)
tree5dee2bd29e6ae836953679854deabe1f930d34f3
parent9640f68c24e109ca42a8535881d4100871895cf9 (diff)
downloadchef-lcg/add-chef-log-syslog.tar.gz
fix global state in specslcg/add-chef-log-syslog
-rw-r--r--spec/unit/log/syslog_spec.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/unit/log/syslog_spec.rb b/spec/unit/log/syslog_spec.rb
index 36b4a01481..3db90e50c6 100644
--- a/spec/unit/log/syslog_spec.rb
+++ b/spec/unit/log/syslog_spec.rb
@@ -24,9 +24,16 @@ describe "Chef::Log::Syslog", :unix_only => true do
let(:app) { Chef::Application.new }
before do
- Chef::Config[:log_level] = :info
- Chef::Config[:log_location] = syslog
- app.configure_logging
+ Chef::Log.init(MonoLogger.new(syslog))
+ @old_log_level = Chef::Log.level
+ Chef::Log.level = :info
+ @old_loggers = Chef::Log.loggers
+ Chef::Log.use_log_devices([syslog])
+ end
+
+ after do
+ Chef::Log.level = @old_log_level
+ Chef::Log.use_log_devices(@old_loggers)
end
it "should send message with severity info to syslog." do