diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-17 09:36:44 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-17 09:36:44 -0700 |
commit | ef05ba4dbd75135c4b17e237bdfa7725f45c4581 (patch) | |
tree | 977e7241f7b97e3ced179645bf375bb026d984d5 /spec | |
parent | a0be94911e5368871f864f33818a936e15de8c70 (diff) | |
download | ohai-ef05ba4dbd75135c4b17e237bdfa7725f45c4581.tar.gz |
fix Style/VariableName
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/plugins/aix/cpu_spec.rb | 8 | ||||
-rw-r--r-- | spec/unit/plugins/aix/filesystem_spec.rb | 16 | ||||
-rw-r--r-- | spec/unit/plugins/aix/virtualization_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/runner_spec.rb | 26 |
4 files changed, 27 insertions, 27 deletions
diff --git a/spec/unit/plugins/aix/cpu_spec.rb b/spec/unit/plugins/aix/cpu_spec.rb index d782ced0..2b762740 100644 --- a/spec/unit/plugins/aix/cpu_spec.rb +++ b/spec/unit/plugins/aix/cpu_spec.rb @@ -20,12 +20,12 @@ require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb") describe Ohai::System, "AIX cpu plugin" do before(:each) do - @lsdev_Cc_processor = <<-LSDEV_CC_PROCESSOR + @lsdev_cc_processor = <<-LSDEV_CC_PROCESSOR proc0 Available 00-00 Processor proc4 Defined 00-04 Processor LSDEV_CC_PROCESSOR - @lsattr_El_proc0 = <<-LSATTR_EL + @lsattr_el_proc0 = <<-LSATTR_EL frequency 1654344000 Processor Speed False smt_enabled true Processor SMT enabled False smt_threads 2 Processor SMT threads False @@ -43,8 +43,8 @@ PMCYCLES_M @plugin = get_plugin("aix/cpu") allow(@plugin).to receive(:collect_os).and_return(:aix) - allow(@plugin).to receive(:shell_out).with("lsdev -Cc processor").and_return(mock_shell_out(0, @lsdev_Cc_processor, nil)) - allow(@plugin).to receive(:shell_out).with("lsattr -El proc0").and_return(mock_shell_out(0, @lsattr_El_proc0, nil)) + allow(@plugin).to receive(:shell_out).with("lsdev -Cc processor").and_return(mock_shell_out(0, @lsdev_cc_processor, nil)) + allow(@plugin).to receive(:shell_out).with("lsattr -El proc0").and_return(mock_shell_out(0, @lsattr_el_proc0, nil)) allow(@plugin).to receive(:shell_out).with("pmcycles -m").and_return(mock_shell_out(0, @pmcycles_m, nil)) end diff --git a/spec/unit/plugins/aix/filesystem_spec.rb b/spec/unit/plugins/aix/filesystem_spec.rb index b71e5f81..33d63af7 100644 --- a/spec/unit/plugins/aix/filesystem_spec.rb +++ b/spec/unit/plugins/aix/filesystem_spec.rb @@ -19,7 +19,7 @@ require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper.rb") describe Ohai::System, "AIX filesystem plugin" do before(:each) do - @df_Pk_LPAR = <<-DF_PK + @df_pk_lpar = <<-DF_PK Filesystem 1024-blocks Used Available Capacity Mounted on /dev/hd4 2097152 219796 1877356 11% / /dev/hd2 5242880 2416828 2826052 47% /usr @@ -46,7 +46,7 @@ Filesystem 1024-blocks Used Available Capacity Mounted on /dev/fslv12 10485760 272376 10213384 3% /wpars/toolchain-tester-5c969f/var DF_PK - @df_Pk_WPAR = <<-DF_PK + @df_pk_wpar = <<-DF_PK Filesystem 1024-blocks Used Available Capacity Mounted on Global 10485760 130872 10354888 2% / Global 5242880 39572 5203308 1% /home @@ -57,7 +57,7 @@ Global 5242880 2725048 2517832 52% /usr Global 10485760 272376 10213384 3% /var DF_PK - @mount_LPAR = <<-MOUNT + @mount_lpar = <<-MOUNT node mounted mounted over vfs date options -------- --------------- --------------- ------ ------------ --------------- /dev/hd4 / jfs2 Jul 17 13:22 rw,log=/dev/hd8 @@ -71,7 +71,7 @@ DF_PK 192.168.1.11 /stage/middleware /stage/middleware nfs3 Jul 17 13:24 ro,bg,hard,intr,sec=sys MOUNT - @mount_WPAR = <<-MOUNT + @mount_wpar = <<-MOUNT node mounted mounted over vfs date options -------- --------------- --------------- ------ ------------ --------------- Global / jfs2 Nov 23 21:03 rw,log=NULL @@ -91,8 +91,8 @@ MOUNT context "when run within an LPAR" do before do - allow(@plugin).to receive(:shell_out).with("df -Pk").and_return(mock_shell_out(0, @df_Pk_LPAR, nil)) - allow(@plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @mount_LPAR, nil)) + allow(@plugin).to receive(:shell_out).with("df -Pk").and_return(mock_shell_out(0, @df_pk_lpar, nil)) + allow(@plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @mount_lpar, nil)) @plugin.run end @@ -153,8 +153,8 @@ MOUNT context "when run within a WPAR" do before do - allow(@plugin).to receive(:shell_out).with("df -Pk").and_return(mock_shell_out(0, @df_Pk_WPAR, nil)) - allow(@plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @mount_WPAR, nil)) + allow(@plugin).to receive(:shell_out).with("df -Pk").and_return(mock_shell_out(0, @df_pk_wpar, nil)) + allow(@plugin).to receive(:shell_out).with("mount").and_return(mock_shell_out(0, @mount_wpar, nil)) @plugin.run end diff --git a/spec/unit/plugins/aix/virtualization_spec.rb b/spec/unit/plugins/aix/virtualization_spec.rb index 3d968e19..4d07f814 100644 --- a/spec/unit/plugins/aix/virtualization_spec.rb +++ b/spec/unit/plugins/aix/virtualization_spec.rb @@ -27,12 +27,12 @@ describe Ohai::System, "AIX virtualization plugin" do allow(p).to receive(:collect_os).and_return(:aix) allow(p).to receive(:shell_out).with("uname -L").and_return(mock_shell_out(0, "29 l273pp027", nil)) allow(p).to receive(:shell_out).with("uname -W").and_return(mock_shell_out(0, "0", nil)) - allow(p).to receive(:shell_out).with("lswpar -L").and_return(mock_shell_out(0, @lswpar_L, nil)) + allow(p).to receive(:shell_out).with("lswpar -L").and_return(mock_shell_out(0, @lswpar_l, nil)) p end before(:each) do - @lswpar_L = <<-LSWPAR_L + @lswpar_l = <<-LSWPAR_L ================================================================= applejack-541ba3 - Active ================================================================= diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb index c35ad64d..2e5ce266 100644 --- a/spec/unit/runner_spec.rb +++ b/spec/unit/runner_spec.rb @@ -319,35 +319,35 @@ describe Ohai::Runner, "run_plugin" do @ohai = Ohai::System.new @runner = Ohai::Runner.new(@ohai, true) - klassA = Ohai.plugin(:A) { + klass_a = Ohai.plugin(:A) { provides("A") depends("B", "C") collect_data {} } - klassB = Ohai.plugin(:B) { + klass_b = Ohai.plugin(:B) { provides("B") depends("C") collect_data {} } - klassC = Ohai.plugin(:C) { + klass_c = Ohai.plugin(:C) { provides("C") collect_data {} } @plugins = [] - [klassA, klassB, klassC].each do |klass| + [klass_a, klass_b, klass_c].each do |klass| @plugins << klass.new(@ohai.data) end - @pluginA, @pluginB, @pluginC = @plugins + @plugin_a, @plugin_b, @plugin_c = @plugins end it "should not detect a cycle when B is the first provider returned" do - @ohai.provides_map.set_providers_for(@pluginA, ["A"]) - @ohai.provides_map.set_providers_for(@pluginB, ["B"]) - @ohai.provides_map.set_providers_for(@pluginC, ["C"]) + @ohai.provides_map.set_providers_for(@plugin_a, ["A"]) + @ohai.provides_map.set_providers_for(@plugin_b, ["B"]) + @ohai.provides_map.set_providers_for(@plugin_c, ["C"]) expect(Ohai::Log).not_to receive(:error).with(/DependencyCycleError/) - @runner.run_plugin(@pluginA) + @runner.run_plugin(@plugin_a) @plugins.each do |plugin| expect(plugin.has_run?).to be true @@ -355,12 +355,12 @@ describe Ohai::Runner, "run_plugin" do end it "should not detect a cycle when C is the first provider returned" do - @ohai.provides_map.set_providers_for(@pluginA, ["A"]) - @ohai.provides_map.set_providers_for(@pluginC, ["C"]) - @ohai.provides_map.set_providers_for(@pluginB, ["B"]) + @ohai.provides_map.set_providers_for(@plugin_a, ["A"]) + @ohai.provides_map.set_providers_for(@plugin_c, ["C"]) + @ohai.provides_map.set_providers_for(@plugin_b, ["B"]) expect(Ohai::Log).not_to receive(:error).with(/DependencyCycleError/) - @runner.run_plugin(@pluginA) + @runner.run_plugin(@plugin_a) @plugins.each do |plugin| expect(plugin.has_run?).to be true |