spec/unit/plugins/linux/filesystem_spec.rb in ohai-13.12.6 vs spec/unit/plugins/linux/filesystem_spec.rb in ohai-14.0.28

- old
+ new

@@ -17,11 +17,11 @@ # require_relative "../../../spec_helper.rb" describe Ohai::System, "Linux filesystem plugin" do - let (:plugin) { get_plugin("linux/filesystem") } + let(:plugin) { get_plugin("linux/filesystem") } before(:each) do allow(plugin).to receive(:collect_os).and_return(:linux) allow(plugin).to receive(:shell_out).with("df -P").and_return(mock_shell_out(0, "", "")) allow(plugin).to receive(:shell_out).with("df -iP").and_return(mock_shell_out(0, "", "")) @@ -53,15 +53,10 @@ allow(File).to receive(:exist?).with("/dev/#{name}").and_return(false) allow(File).to receive(:exist?).with("/dev/mapper/#{name}").and_return(true) end end - it "sets both filesystem and filesystem2 attributes" do - plugin.run - expect(plugin[:filesystem]).to eq(plugin[:filesystem2]) - end - describe "when gathering filesystem usage data from df" do before(:each) do @stdout = <<-DF Filesystem 1024-blocks Used Available Capacity Mounted on /dev/mapper/sys.vg-root.lv 4805760 378716 4182924 9% / @@ -543,10 +538,10 @@ 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.") + expect_any_instance_of(Mixlib::Log::Child).to receive(:warn).with("Plugin Filesystem: #{command} binary is not available. Some data will not be available.") plugin.run end end end end