Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some lint cops: #704

Merged
merged 1 commit into from
Jan 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/ohai/plugins/darwin/memory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
vm_stat = shell_out("vm_stat").stdout
vm_stat_match = /page size of (\d+) bytes/.match(vm_stat)
page_size = if vm_stat_match and vm_stat_match[1]
vm_stat_match[1].to_i
else
4096
end
vm_stat_match[1].to_i
else
4096
end

vm_stat.split("\n").each do |line|
['wired down', 'active', 'inactive'].each do |match|
unless line.index("Pages #{match}:").nil?
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/plugins/aix/memory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
allow(@plugin).to receive(:shell_out).with("svmon -G -O unit=MB,summary=longreal | grep '[0-9]'").and_return(mock_shell_out(0, " 513280.00 340034.17 173245.83 62535.17 230400.05 276950.14 70176.00\n", nil))
@swap_s = "allocated = 23887872 blocks used = 288912 blocks free = 23598960 blocks\n"
allow(@plugin).to receive(:shell_out).with("swap -s").and_return(mock_shell_out(0,@swap_s, nil))
end
end

it "should get total memory" do
@plugin.run
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/plugins/ruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
:host_vendor => ::RbConfig::CONFIG['host_vendor'],
:gems_dir => %x{#{ruby_bin} #{::RbConfig::CONFIG['bindir']}/gem env gemdir}.chomp,
:gem_bin => [ ::Gem.default_exec_format % 'gem', 'gem' ].map{|bin| "#{::RbConfig::CONFIG['bindir']}/#{bin}"
}.find{|bin| ::File.exists? bin},
}.find{|bin| ::File.exists? bin},
:ruby_bin => ruby_bin
}.each do |attribute, value|
it "should have #{attribute} set to #{value.inspect}" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/plugins/solaris2/cpu_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2888,7 +2888,7 @@
expect(@plugin["cpu"]["104"]["core_id"]).to eql("1117")
expect(@plugin["cpu"]["112"]["core_id"]).to eql("1124")
expect(@plugin["cpu"]["120"]["core_id"]).to eql("1131")
end
end

it "should include processor architecture" do
expect(@plugin["cpu"]["0"]["arch"]).to eql("sparcv9")
Expand Down