summaryrefslogtreecommitdiff
path: root/spec/unit/plugins/windows
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2016-11-18 12:00:47 -0800
committerTim Smith <tsmith@chef.io>2016-12-01 10:58:06 -0800
commit3b65f582afe867180573313db3eb6450abf1da9b (patch)
tree4eadf04c5959ad39cb56e150f7fa510925b32168 /spec/unit/plugins/windows
parent5f43d30a38cee0a87c479988283a6bd934c07d01 (diff)
downloadohai-rubocop_rspec.tar.gz
rspec-rubocop autofix the specsrubocop_rspec
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/plugins/windows')
-rw-r--r--spec/unit/plugins/windows/cpu_spec.rb22
-rw-r--r--spec/unit/plugins/windows/fips_spec.rb2
-rw-r--r--spec/unit/plugins/windows/memory_spec.rb8
-rw-r--r--spec/unit/plugins/windows/uptime_spec.rb6
-rw-r--r--spec/unit/plugins/windows/virtualization_spec.rb2
5 files changed, 20 insertions, 20 deletions
diff --git a/spec/unit/plugins/windows/cpu_spec.rb b/spec/unit/plugins/windows/cpu_spec.rb
index 313104bf..74d03573 100644
--- a/spec/unit/plugins/windows/cpu_spec.rb
+++ b/spec/unit/plugins/windows/cpu_spec.rb
@@ -24,39 +24,39 @@ shared_examples "a cpu" do |cpu_no|
expect(@plugin[:cpu]["#{cpu_no}"][:physical_id]).to eq("CPU#{cpu_no}")
end
- it "should set mhz to 2793" do
+ it "sets mhz to 2793" do
expect(@plugin[:cpu]["#{cpu_no}"][:mhz]).to eq("2793")
end
- it "should set vendor_id to GenuineIntel" do
+ it "sets vendor_id to GenuineIntel" do
expect(@plugin[:cpu]["#{cpu_no}"][:vendor_id]).to eq("GenuineIntel")
end
- it "should set model_name to Intel64 Family 6 Model 70 Stepping 1" do
+ it "sets model_name to Intel64 Family 6 Model 70 Stepping 1" do
expect(@plugin[:cpu]["#{cpu_no}"][:model_name])
.to eq("Intel64 Family 6 Model 70 Stepping 1")
end
- it "should set model to 17921" do
+ it "sets model to 17921" do
expect(@plugin[:cpu]["#{cpu_no}"][:model]).to eq("17921")
end
- it "should set family to 2" do
+ it "sets family to 2" do
expect(@plugin[:cpu]["#{cpu_no}"][:family]).to eq("2")
end
- it "should set stepping to 9" do
+ it "sets stepping to 9" do
expect(@plugin[:cpu]["#{cpu_no}"][:stepping]).to eq(9)
end
- it "should set cache_size to 64 KB" do
+ it "sets cache_size to 64 KB" do
expect(@plugin[:cpu]["#{cpu_no}"][:cache_size]).to eq("64 KB")
end
end
end
describe Ohai::System, "Windows cpu plugin" do
- before(:each) do
+ before do
@plugin = get_plugin("windows/cpu")
allow(@plugin).to receive(:collect_os).and_return(:windows)
@@ -94,15 +94,15 @@ describe Ohai::System, "Windows cpu plugin" do
@plugin.run
end
- it "should set total cpu to 2" do
+ it "sets total cpu to 2" do
expect(@plugin[:cpu][:total]).to eq(4)
end
- it "should set real cpu to 2" do
+ it "sets real cpu to 2" do
expect(@plugin[:cpu][:real]).to eq(2)
end
- it "should set 2 distinct cpus numbered 0 and 1" do
+ it "sets 2 distinct cpus numbered 0 and 1" do
expect(@plugin[:cpu]).to have_key("0")
expect(@plugin[:cpu]).to have_key("1")
end
diff --git a/spec/unit/plugins/windows/fips_spec.rb b/spec/unit/plugins/windows/fips_spec.rb
index 29138082..4aad7a40 100644
--- a/spec/unit/plugins/windows/fips_spec.rb
+++ b/spec/unit/plugins/windows/fips_spec.rb
@@ -24,7 +24,7 @@ describe Ohai::System, "plugin fips", :windows_only do
let(:fips_key) { 'System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy' }
let(:win_reg_entry) { { "Enabled" => enabled } }
- before(:each) do
+ before do
allow(plugin).to receive(:collect_os).and_return(:windows)
allow(Win32::Registry::HKEY_LOCAL_MACHINE).to receive(:open).with(fips_key, arch).and_yield(win_reg_entry)
end
diff --git a/spec/unit/plugins/windows/memory_spec.rb b/spec/unit/plugins/windows/memory_spec.rb
index 0579439b..cd2a7c5a 100644
--- a/spec/unit/plugins/windows/memory_spec.rb
+++ b/spec/unit/plugins/windows/memory_spec.rb
@@ -29,22 +29,22 @@ describe Ohai::System, "Windows memory plugin", :windows_only do
expect_any_instance_of(WmiLite::Wmi).to receive(:first_of).with("Win32_OperatingSystem").and_return(mock_os)
end
- it "should get total memory" do
+ it "gets total memory" do
@plugin.run
expect(@plugin["memory"]["total"]).to eql("10485760kB")
end
- it "should get free memory" do
+ it "gets free memory" do
@plugin.run
expect(@plugin["memory"]["free"]).to eql("5242880kB")
end
- it "should get total swap" do
+ it "gets total swap" do
@plugin.run
expect(@plugin["memory"]["swap"]["total"]).to eql("20971520kB")
end
- it "should get free memory" do
+ it "gets free memory" do
@plugin.run
expect(@plugin["memory"]["swap"]["free"]).to eql("15728640kB")
end
diff --git a/spec/unit/plugins/windows/uptime_spec.rb b/spec/unit/plugins/windows/uptime_spec.rb
index 05d2fd2f..73e560ae 100644
--- a/spec/unit/plugins/windows/uptime_spec.rb
+++ b/spec/unit/plugins/windows/uptime_spec.rb
@@ -22,7 +22,7 @@ describe Ohai::System, "Windows plugin uptime" do
let(:wmi) { double("wmi", { :first_of => "" }) }
- before(:each) do
+ before do
allow(WmiLite::Wmi).to receive(:new).and_return(wmi)
end
@@ -49,8 +49,8 @@ describe Ohai::System, "Windows plugin uptime" do
it "uses Win32_PerfFormattedData_PerfOS_System WMI class to fetch the system's uptime" do
expect(wmi).to receive(:first_of).with("Win32_PerfFormattedData_PerfOS_System")
- expect(Time).to_not receive(:new)
- expect(Time).to_not receive(:parse)
+ expect(Time).not_to receive(:new)
+ expect(Time).not_to receive(:parse)
expect(uptime_plugin).to receive(:seconds_to_human)
uptime_plugin.run
end
diff --git a/spec/unit/plugins/windows/virtualization_spec.rb b/spec/unit/plugins/windows/virtualization_spec.rb
index 124e92f6..7243c5c2 100644
--- a/spec/unit/plugins/windows/virtualization_spec.rb
+++ b/spec/unit/plugins/windows/virtualization_spec.rb
@@ -23,7 +23,7 @@ require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb")
describe Ohai::System, "Windows virtualization platform" do
let(:plugin) { get_plugin("windows/virtualization") }
- before(:each) do
+ before do
allow(plugin).to receive(:collect_os).and_return(:windows)
end