summaryrefslogtreecommitdiff
path: root/spec/unit/plugins/darwin/filesystem2_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/plugins/darwin/filesystem2_spec.rb')
-rw-r--r--spec/unit/plugins/darwin/filesystem2_spec.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/unit/plugins/darwin/filesystem2_spec.rb b/spec/unit/plugins/darwin/filesystem2_spec.rb
index 2a652593..10091682 100644
--- a/spec/unit/plugins/darwin/filesystem2_spec.rb
+++ b/spec/unit/plugins/darwin/filesystem2_spec.rb
@@ -20,7 +20,7 @@ require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
describe Ohai::System, "darwin filesystem2 plugin" do
let (:plugin) { get_plugin("darwin/filesystem2") }
- 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 filesystem2 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[:filesystem2]["by_pair"]["/dev/disk0s2,/"][:kb_size]).to eq("244277768")
expect(plugin[:filesystem2]["by_pair"]["/dev/disk0s2,/"][:kb_used]).to eq("156848224")
@@ -54,13 +54,13 @@ DF
expect(plugin[:filesystem2]["by_pair"]["/dev/disk0s2,/"][:percent_used]).to eq("65%")
end
- it "should set device and mount to value from df -i" do
+ it "sets device and mount to value from df -i" do
plugin.run
expect(plugin[:filesystem2]["by_pair"]["/dev/disk0s2,/"][:mount]).to eq("/")
expect(plugin[:filesystem2]["by_pair"]["/dev/disk0s2,/"][:device]).to eq("/dev/disk0s2")
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[:filesystem2]["by_pair"]["/dev/disk0s2,/"][:total_inodes]).to eq("61069440")
expect(plugin[:filesystem2]["by_pair"]["/dev/disk0s2,/"][:inodes_used]).to eq("39276054")
@@ -69,7 +69,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)
@@ -81,12 +81,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[:filesystem2]["by_pair"]["/dev/disk0s2,/"][:mount]).to eq("/")
expect(plugin[:filesystem2]["by_pair"]["/dev/disk0s2,/"][:fs_type]).to eq("hfs")
@@ -95,7 +95,7 @@ MOUNT
end
describe "when gathering filesystem data with devices mounted more than once" do
- before(:each) do
+ before do
@dfstdout = <<-DF
Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk0s2 488555536 313696448 174347088 65% 39276054 21793386 64% /
@@ -109,14 +109,14 @@ DF
allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @dfstdout, ""))
end
- it "should provide a devices view with all mountpoints" do
+ it "provides a devices view with all mountpoints" do
plugin.run
expect(plugin[:filesystem2]["by_device"]["/dev/disk0s2"][:mounts]).to eq(["/", "/another/mountpoint"])
end
end
describe "when gathering filesystem data with double-mounts" do
- before(:each) do
+ before do
@dfstdout = <<-DF
Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk0s2 488555536 313696448 174347088 65% 39276054 21793386 64% /
@@ -131,7 +131,7 @@ DF
allow(plugin).to receive(:shell_out).with("df -i").and_return(mock_shell_out(0, @dfstdout, ""))
end
- it "should provide a mounts view with all devices" do
+ it "provides a mounts view with all devices" do
plugin.run
expect(plugin[:filesystem2]["by_mountpoint"]["/mnt"][:devices]).to eq(["/dev/disk0s3", "/dev/disk0s4"])
end