summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-09-08 16:52:47 -0700
committerTim Smith <tsmith84@gmail.com>2020-09-08 16:52:47 -0700
commitaa5f3b9e9073139e598478932cb0102331b8c6f8 (patch)
tree474aabb86e81e571f06b950680922821bfd403a7 /spec
parent6fefe9971a84dcf5d8b3a0fcdce249d946e3f63e (diff)
downloadohai-aa5f3b9e9073139e598478932cb0102331b8c6f8.tar.gz
Resolve RuboCop Style/RedundantParentheses warnings
Simplify the code so it's easier to read Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/mixin/dmi_decode_spec.rb2
-rw-r--r--spec/unit/plugins/bsd/virtualization_spec.rb4
-rw-r--r--spec/unit/plugins/netbsd/kernel_spec.rb2
3 files changed, 4 insertions, 4 deletions
diff --git a/spec/unit/mixin/dmi_decode_spec.rb b/spec/unit/mixin/dmi_decode_spec.rb
index a14cc749..656bc721 100644
--- a/spec/unit/mixin/dmi_decode_spec.rb
+++ b/spec/unit/mixin/dmi_decode_spec.rb
@@ -38,7 +38,7 @@ describe Ohai::Mixin::DmiDecode, "guest_from_dmi_data" do
}.each_pair do |hypervisor, values|
describe "when passed #{hypervisor} dmi data" do
it "returns '#{hypervisor}'" do
- expect(mixin.guest_from_dmi_data(values[0], values[1], values[2])).to eq("#{hypervisor}")
+ expect(mixin.guest_from_dmi_data(values[0], values[1], values[2])).to eq(hypervisor.to_s)
end
end
end
diff --git a/spec/unit/plugins/bsd/virtualization_spec.rb b/spec/unit/plugins/bsd/virtualization_spec.rb
index 051b24da..db2ed2e1 100644
--- a/spec/unit/plugins/bsd/virtualization_spec.rb
+++ b/spec/unit/plugins/bsd/virtualization_spec.rb
@@ -24,7 +24,7 @@ describe Ohai::System, "BSD virtualization plugin" do
before do
allow(plugin).to receive(:collect_os).and_return(:freebsd)
allow(plugin).to receive(:shell_out).with("sysctl -n security.jail.jailed").and_return(mock_shell_out(0, "0", ""))
- allow(plugin).to receive(:shell_out).with((Ohai.abs_path( "/sbin/kldstat" )).to_s).and_return(mock_shell_out(0, "", ""))
+ allow(plugin).to receive(:shell_out).with(Ohai.abs_path( "/sbin/kldstat" ).to_s).and_return(mock_shell_out(0, "", ""))
allow(plugin).to receive(:shell_out).with("jls -nd").and_return(mock_shell_out(0, "", ""))
allow(plugin).to receive(:shell_out).with("sysctl -n hw.model").and_return(mock_shell_out(0, "", ""))
allow(plugin).to receive(:shell_out).with("sysctl -n kern.vm_guest").and_return(mock_shell_out(0, "", ""))
@@ -79,7 +79,7 @@ describe Ohai::System, "BSD virtualization plugin" do
1 40 0xffffffff80100000 d20428 kernel
7 3 0xffffffff81055000 41e88 vboxguest.ko
OUT
- allow(plugin).to receive(:shell_out).with((Ohai.abs_path("/sbin/kldstat")).to_s).and_return(mock_shell_out(0, @vbox_guest, ""))
+ allow(plugin).to receive(:shell_out).with(Ohai.abs_path("/sbin/kldstat").to_s).and_return(mock_shell_out(0, @vbox_guest, ""))
end
it "detects we are a guest" do
diff --git a/spec/unit/plugins/netbsd/kernel_spec.rb b/spec/unit/plugins/netbsd/kernel_spec.rb
index 77803103..4946ffd0 100644
--- a/spec/unit/plugins/netbsd/kernel_spec.rb
+++ b/spec/unit/plugins/netbsd/kernel_spec.rb
@@ -25,7 +25,7 @@ describe Ohai::System, "NetBSD kernel plugin" do
allow(@plugin).to receive(:init_kernel).and_return({})
allow(@plugin).to receive(:shell_out).with("uname -i").and_return(mock_shell_out(0, "foo", ""))
allow(@plugin).to receive(:shell_out).with("sysctl kern.securelevel").and_return(mock_shell_out(0, "kern.securelevel: 1\n", ""))
- allow(@plugin).to receive(:shell_out).with((Ohai.abs_path( "/usr/bin/modstat" )).to_s).and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
+ allow(@plugin).to receive(:shell_out).with(Ohai.abs_path( "/usr/bin/modstat" ).to_s).and_return(mock_shell_out(0, " 1 7 0xc0400000 97f830 kernel", ""))
end
it "sets the kernel_os to the kernel_name value" do