spec/unit/plugins/linux/filesystem_spec.rb in ohai-13.5.0 vs spec/unit/plugins/linux/filesystem_spec.rb in ohai-13.6.0

- old
+ new

@@ -531,11 +531,20 @@ expect(plugin[:filesystem]["by_mountpoint"]["/mnt"][:devices]).to eq(["/dev/sdb1", "/dev/sdc1"]) end end %w{df mount}.each do |command| - describe "when #{command} does not exist" do + describe "when :allow_partial_data set, #{command} does not exist" do + before do + Ohai.config[:plugin][:filesystem][:allow_partial_data] = true + end + + after do + Ohai.config[:plugin][:filesystem][:allow_partial_data] = false + end + it "logs warning about #{command} missing" do + Ohai.config[:plugin][:filesystem][:allow_partial_data] = true allow(plugin).to receive(:shell_out).with(/#{command}/).and_raise(Ohai::Exceptions::Exec) expect(Ohai::Log).to receive(:warn).with("Plugin Filesystem: #{command} binary is not available. Some data will not be available.") plugin.run end end