summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-08-17 12:05:02 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-08-17 12:05:02 -0700
commite756f15f1034757cce5123c7fa9c77ff6627e313 (patch)
treea75959d0916ebb75ecdc5db4a3a36137e2786d99
parentef05ba4dbd75135c4b17e237bdfa7725f45c4581 (diff)
downloadohai-e756f15f1034757cce5123c7fa9c77ff6627e313.tar.gz
Style/StringLiterals fixes from rubocop 0.42.0
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/ohai/common/dmi.rb8
-rw-r--r--spec/functional/application_spec.rb2
-rw-r--r--spec/unit/application_spec.rb2
-rw-r--r--spec/unit/plugins/darwin/hardware_system_profiler_output.rb6
-rw-r--r--spec/unit/plugins/linux/network_spec.rb10
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb4
-rw-r--r--spec/unit/util/ip_helper_spec.rb4
7 files changed, 18 insertions, 18 deletions
diff --git a/lib/ohai/common/dmi.rb b/lib/ohai/common/dmi.rb
index 2b5e2ff4..918a0cea 100644
--- a/lib/ohai/common/dmi.rb
+++ b/lib/ohai/common/dmi.rb
@@ -24,7 +24,7 @@ module Ohai
# all-lowercase, all non-alphanumeric converted to '_'
# 128-255 are 'oem_data_[id]'
# Everything else is 'unknown'
- IdToDescription = {
+ ID_TO_DESCRIPTION = {
0 => "bios",
1 => "system",
2 => "base_board",
@@ -71,7 +71,7 @@ module Ohai
# list of IDs to collect, otherwise we generate pages of hashes about cache chip size and whatnot
# See OHAI-260. When we can give the user a choice, this will be a default.
- IdToCapture = [ 0, 1, 2, 3, 4, 6, 11 ]
+ ID_TO_CAPTURE = [ 0, 1, 2, 3, 4, 6, 11 ]
# look up DMI ID
def id_lookup(id)
@@ -79,8 +79,8 @@ module Ohai
id = id.to_i
if (id >= 128) && (id <= 255)
id = "oem_data_#{id}"
- elsif DMI::IdToDescription.has_key?(id)
- id = DMI::IdToDescription[id]
+ elsif DMI::ID_TO_DESCRIPTION.has_key?(id)
+ id = DMI::ID_TO_DESCRIPTION[id]
else
Ohai::Log.debug("unrecognized header id; falling back to 'unknown'")
id = "unknown"
diff --git a/spec/functional/application_spec.rb b/spec/functional/application_spec.rb
index 5c98e6ff..79e8c3ed 100644
--- a/spec/functional/application_spec.rb
+++ b/spec/functional/application_spec.rb
@@ -35,7 +35,7 @@ RSpec.describe "Ohai::Application" do
ARGV.replace(@original_argv)
end
- describe '#configure_ohai' do
+ describe "#configure_ohai" do
let(:config_content) { "" }
let(:config_dir) { Dir.mktmpdir(".chef") }
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index 0f45786e..e815063f 100644
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -34,7 +34,7 @@ RSpec.describe "Ohai::Application" do
ARGV.replace(@original_argv)
end
- describe '#configure_ohai' do
+ describe "#configure_ohai" do
describe "loading configuration from a file" do
let(:config_file) { "/local/workstation/config" }
let(:config_loader) { instance_double("ChefConfig::WorkstationConfigLoader") }
diff --git a/spec/unit/plugins/darwin/hardware_system_profiler_output.rb b/spec/unit/plugins/darwin/hardware_system_profiler_output.rb
index 086ebec0..d56f2223 100644
--- a/spec/unit/plugins/darwin/hardware_system_profiler_output.rb
+++ b/spec/unit/plugins/darwin/hardware_system_profiler_output.rb
@@ -1,5 +1,5 @@
module HardwareSystemProfilerOutput
- Hardware = <<hardware_output
+ HARDWARE = <<hardware_output
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@@ -289,7 +289,7 @@ module HardwareSystemProfilerOutput
</plist>
hardware_output
- Storage = <<storage_output
+ STORAGE = <<storage_output
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@@ -600,7 +600,7 @@ hardware_output
</plist>
storage_output
- Power = <<power_output
+ POWER = <<power_output
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
diff --git a/spec/unit/plugins/linux/network_spec.rb b/spec/unit/plugins/linux/network_spec.rb
index e2037fc3..3134bb94 100644
--- a/spec/unit/plugins/linux/network_spec.rb
+++ b/spec/unit/plugins/linux/network_spec.rb
@@ -392,7 +392,7 @@ EOM
end
end
- describe '#interface_has_no_addresses_in_family?' do
+ describe "#interface_has_no_addresses_in_family?" do
context "when interface has no addresses" do
let(:iface) { {} }
@@ -418,7 +418,7 @@ EOM
end
end
- describe '#interface_have_address?' do
+ describe "#interface_have_address?" do
context "when interface has no addresses" do
let(:iface) { {} }
@@ -444,7 +444,7 @@ EOM
end
end
- describe '#interface_address_not_link_level?' do
+ describe "#interface_address_not_link_level?" do
context "when the address scope is link" do
let(:iface) { { addresses: { "1.2.3.4" => { scope: "Link" } } } }
@@ -462,7 +462,7 @@ EOM
end
end
- describe '#interface_valid_for_route?' do
+ describe "#interface_valid_for_route?" do
let(:iface) { double("iface") }
let(:address) { "1.2.3.4" }
let(:family) { "inet" }
@@ -508,7 +508,7 @@ EOM
end
end
- describe '#route_is_valid_default_route?' do
+ describe "#route_is_valid_default_route?" do
context "when the route destination is default" do
let(:route) { { destination: "default" } }
let(:default_route) { double("default_route") }
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index fffa7d51..5bff78e4 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -699,7 +699,7 @@ CISCO_RELEASE
end
end
- describe '#read_os_release_info' do
+ describe "#read_os_release_info" do
let(:file_contents) { "COW=MOO\nDOG=\"BARK\"" }
it "returns nil if the file does not exist" do
allow(File).to receive(:exist?).with("/etc/test-release").and_return(false)
@@ -716,7 +716,7 @@ CISCO_RELEASE
end
end
- describe '#os_release_info' do
+ describe "#os_release_info" do
context "when CISCO_RELEASE_INFO is not populated" do
let(:release_info) { { "ID" => "os_id" } }
diff --git a/spec/unit/util/ip_helper_spec.rb b/spec/unit/util/ip_helper_spec.rb
index 766a9636..0532cbc9 100644
--- a/spec/unit/util/ip_helper_spec.rb
+++ b/spec/unit/util/ip_helper_spec.rb
@@ -78,12 +78,12 @@ describe "Ohai::Util::IpHelper" do
allow(ip_helper).to receive(:private_address?)
end
- it 'should call #private_address?' do
+ it "should call #private_address?" do
expect(ip_helper).to receive(:private_address?)
ip_helper.public_address?(address)
end
- it 'should return the inverse of #private_address?' do
+ it "should return the inverse of #private_address?" do
expect(ip_helper.public_address?(address)).to equal !ip_helper.private_address?(address)
end
end