diff options
author | Claire McQuin <claire@getchef.com> | 2015-07-20 17:17:15 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2015-07-27 09:24:19 -0700 |
commit | b34f65e313c282926967093904d04dd248a6cd83 (patch) | |
tree | 2ad312cc814aa74ab04aaff6675d8e5b016aa90c /spec | |
parent | 247a910aaf8b6d78df56780f800a05a5120f0e2b (diff) | |
download | chef-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.rb | 31 |
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 |