diff options
Diffstat (limited to 'spec/unit/plugins/darwin/filesystem_spec.rb')
-rw-r--r-- | spec/unit/plugins/darwin/filesystem_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/plugins/darwin/filesystem_spec.rb b/spec/unit/plugins/darwin/filesystem_spec.rb index b703bce9..14645eaa 100644 --- a/spec/unit/plugins/darwin/filesystem_spec.rb +++ b/spec/unit/plugins/darwin/filesystem_spec.rb @@ -20,7 +20,7 @@ require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb") describe Ohai::System, "darwin filesystem plugin" do let (:plugin) { get_plugin("darwin/filesystem") } - before(:each) do + before do allow(plugin).to receive(:collect_os).and_return(:darwin) allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, "", "")) @@ -28,7 +28,7 @@ describe Ohai::System, "darwin filesystem plugin" do end describe "when gathering filesystem usage data from df" do - before(:each) do + before do @stdout = <<-DF Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on /dev/disk0s2 488555536 313696448 174347088 65% 39276054 21793386 64% / @@ -41,12 +41,12 @@ DF allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @stdout, "")) end - it "should run df -i" do + it "runs df -i" do expect(plugin).to receive(:shell_out).ordered.with("df -i").and_return(mock_shell_out(0, @stdout, "")) plugin.run end - it "should set size to value from df -i" do + it "sets size to value from df -i" do plugin.run expect(plugin[:filesystem]["/dev/disk0s2"][:kb_size]).to eq(244277768) expect(plugin[:filesystem]["/dev/disk0s2"][:kb_used]).to eq(156848224) @@ -54,12 +54,12 @@ DF expect(plugin[:filesystem]["/dev/disk0s2"][:percent_used]).to eq("65%") end - it "should set mount to value from df -i" do + it "sets mount to value from df -i" do plugin.run expect(plugin[:filesystem]["/dev/disk0s2"][:mount]).to eq("/") end - it "should set inode info to value from df -i" do + it "sets inode info to value from df -i" do plugin.run expect(plugin[:filesystem]["/dev/disk0s2"][:total_inodes]).to eq("61069440") expect(plugin[:filesystem]["/dev/disk0s2"][:inodes_used]).to eq("39276054") @@ -68,7 +68,7 @@ DF end describe "when gathering mounted filesystem data from mount" do - before(:each) do + before do @stdout = <<-MOUNT /dev/disk0s2 on / (hfs, local, journaled) devfs on /dev (devfs, local, nobrowse) @@ -80,12 +80,12 @@ MOUNT allow(plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @stdout, "")) end - it "should run mount" do + it "runs mount" do expect(plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @stdout, "")) plugin.run end - it "should set values from mount" do + it "sets values from mount" do plugin.run expect(plugin[:filesystem]["/dev/disk0s2"][:mount]).to eq("/") expect(plugin[:filesystem]["/dev/disk0s2"][:fs_type]).to eq("hfs") |