summaryrefslogtreecommitdiff
path: root/spec/unit/config_spec.rb
blob: 68cb58925196f93be10c0b2d1c885929ed26e764 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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