diff options
author | Tim Smith <tsmith@chef.io> | 2017-12-02 22:30:59 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2017-12-02 22:30:59 -0800 |
commit | 76dfb9fa32056d66fb4297d1a2e8a65512404f82 (patch) | |
tree | 36dbeb6c6de2ab3981069b4adebef8f732eb5064 | |
parent | 33f711936b9b8dfe0c5a6c5decef3d43c207ddee (diff) | |
download | ohai-76dfb9fa32056d66fb4297d1a2e8a65512404f82.tar.gz |
Remove extra ()s on methodsredundant
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/plugins/cloud.rb | 2 | ||||
-rw-r--r-- | lib/ohai/plugins/linux/platform.rb | 2 | ||||
-rw-r--r-- | lib/ohai/system.rb | 4 | ||||
-rw-r--r-- | spec/unit/plugins/cloud_spec.rb | 10 | ||||
-rw-r--r-- | spec/unit/plugins/powershell_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/system_spec.rb | 4 |
6 files changed, 12 insertions, 12 deletions
diff --git a/lib/ohai/plugins/cloud.rb b/lib/ohai/plugins/cloud.rb index 58011d65..dff44505 100644 --- a/lib/ohai/plugins/cloud.rb +++ b/lib/ohai/plugins/cloud.rb @@ -298,7 +298,7 @@ Ohai.plugin(:Cloud) do collect_data do require "ipaddr" - @cloud_attr_obj = CloudAttrs.new() + @cloud_attr_obj = CloudAttrs.new get_gce_values if on_gce? get_ec2_values if on_ec2? diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb index d8048eae..f92749bc 100644 --- a/lib/ohai/plugins/linux/platform.rb +++ b/lib/ohai/plugins/linux/platform.rb @@ -249,7 +249,7 @@ Ohai.plugin(:Platform) do platform_version `uname -r`.strip elsif File.exist?("/etc/alpine-release") platform "alpine" - platform_version File.read("/etc/alpine-release").strip() + platform_version File.read("/etc/alpine-release").strip elsif File.exist?("/usr/lib/os-release") contents = File.read("/usr/lib/os-release") if /Clear Linux/ =~ contents diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb index dafa90bc..13d60bf0 100644 --- a/lib/ohai/system.rb +++ b/lib/ohai/system.rb @@ -62,7 +62,7 @@ module Ohai @loader = Ohai::Loader.new(self) @runner = Ohai::Runner.new(self, true) - Ohai::Hints.refresh_hints() + Ohai::Hints.refresh_hints # Remove the previously defined plugins recursive_remove_constants(Ohai::NamedPlugin) @@ -193,7 +193,7 @@ module Ohai # This method takes a naive approach to v6 plugins: it simply re-runs all # of them whenever called. def refresh_plugins(attribute_filter = nil) - Ohai::Hints.refresh_hints() + Ohai::Hints.refresh_hints @provides_map.all_plugins(attribute_filter).each do |plugin| plugin.reset! end diff --git a/spec/unit/plugins/cloud_spec.rb b/spec/unit/plugins/cloud_spec.rb index ae9de7b3..6c136c40 100644 --- a/spec/unit/plugins/cloud_spec.rb +++ b/spec/unit/plugins/cloud_spec.rb @@ -39,7 +39,7 @@ describe "CloudAttrs object" do end it "populates cloud mash" do - @cloud_attr_obj = ::CloudAttrs.new() + @cloud_attr_obj = ::CloudAttrs.new @cloud_attr_obj.add_ipv4_addr("1.2.3.1", :public) @cloud_attr_obj.add_ipv4_addr("1.2.4.1", :private) @cloud_attr_obj.add_ipv6_addr("3ffe:505:2::1", :public) @@ -51,22 +51,22 @@ describe "CloudAttrs object" do end it "throws exception with a bad ipv4 address" do - @cloud_attr_obj = ::CloudAttrs.new() + @cloud_attr_obj = ::CloudAttrs.new expect { @cloud_attr_obj.add_ipv6_addr("somebogusstring", :public) }.to raise_error(RuntimeError) end it "throws exception with a bad ipv6 address" do - @cloud_attr_obj = ::CloudAttrs.new() + @cloud_attr_obj = ::CloudAttrs.new expect { @cloud_attr_obj.add_ipv6_addr("FEED:B0B:DEAD:BEEF", :public) }.to raise_error(RuntimeError) end it "throws exception with ipv6 address passed to ipv4" do - @cloud_attr_obj = ::CloudAttrs.new() + @cloud_attr_obj = ::CloudAttrs.new expect { @cloud_attr_obj.add_ipv4_addr("3ffe:506:2::1", :public) }.to raise_error(RuntimeError) end it "throws exception with ipv4 address passed to ipv6" do - @cloud_attr_obj = ::CloudAttrs.new() + @cloud_attr_obj = ::CloudAttrs.new expect { @cloud_attr_obj.add_ipv6_addr("1.2.3.4", :public) }.to raise_error(RuntimeError) end diff --git a/spec/unit/plugins/powershell_spec.rb b/spec/unit/plugins/powershell_spec.rb index ffc6c65d..d18429fc 100644 --- a/spec/unit/plugins/powershell_spec.rb +++ b/spec/unit/plugins/powershell_spec.rb @@ -45,7 +45,7 @@ PSRemotingProtocolVersion 2.2 END compat_version_array = ["1.0", "2.0", "3.0", "4.0"] - allow(plugin).to receive(:shell_out).with(anything()).and_return(mock_shell_out(0, v4_output, "")) + allow(plugin).to receive(:shell_out).with(anything).and_return(mock_shell_out(0, v4_output, "")) allow(plugin).to receive(:parse_compatible_versions).and_return(compat_version_array) plugin.run expect(plugin.languages[:powershell][:version]).to eql("4.0") diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb index a2e85843..72aa9b0b 100644 --- a/spec/unit/system_spec.rb +++ b/spec/unit/system_spec.rb @@ -79,12 +79,12 @@ describe "Ohai::System" do log_level = :debug Ohai.config[:log_level] = log_level expect(Ohai::Log).not_to receive(:level=).with(log_level) - Ohai::System.new() + Ohai::System.new end it "does not resolve log_level when set to :auto" do expect(Ohai::Log).not_to receive(:level=).with(:info) - Ohai::System.new() + Ohai::System.new end end end |