summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2015-07-20 17:17:15 -0700
committerClaire McQuin <claire@getchef.com>2015-07-27 09:24:19 -0700
commitb34f65e313c282926967093904d04dd248a6cd83 (patch)
tree2ad312cc814aa74ab04aaff6675d8e5b016aa90c /spec
parent247a910aaf8b6d78df56780f800a05a5120f0e2b (diff)
downloadchef-b34f65e313c282926967093904d04dd248a6cd83.tar.gz
Mute :log_level and :log_location deprecation warnings from ohai config.
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/config_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
new file mode 100644
index 0000000000..8d155c61ab
--- /dev/null
+++ b/spec/unit/config_spec.rb
@@ -0,0 +1,31 @@
+
+require 'spec_helper'
+
+require 'chef/config'
+
+RSpec.describe Chef::Config do
+
+ shared_examples_for "deprecated by ohai but not deprecated" do
+ it "does not emit a deprecation warning when set" do
+ expect(Chef::Log).to_not receive(:warn).
+ with(/Ohai::Config\[:#{option}\] is deprecated/)
+ Chef::Config[option] = value
+ expect(Chef::Config[option]).to eq(value)
+ end
+ end
+
+ describe ":log_level" do
+ include_examples "deprecated by ohai but not deprecated" do
+ let(:option) { :log_level }
+ let(:value) { :debug }
+ end
+ end
+
+ describe ":log_location" do
+ include_examples "deprecated by ohai but not deprecated" do
+ let(:option) { :log_location }
+ let(:value) { "path/to/log" }
+ end
+ end
+
+end