summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-09 17:04:30 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-09 17:04:30 -0700
commit691d6cb53709e1ed2d4c2e7551d0d9747001acde (patch)
tree3c5786de48953753425c3cb8e5f267c9d17ac841 /spec
parent157fa672190a4793429bf4c11043e010bf86e5ca (diff)
downloadohai-691d6cb53709e1ed2d4c2e7551d0d9747001acde.tar.gz
Gate more of the external requires
Decreases memory usage slightly Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/plugins/cloud_spec.rb2
-rw-r--r--spec/unit/plugins/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/linux/network_spec.rb2
-rw-r--r--spec/unit/plugins/windows/dmi_spec.rb2
-rw-r--r--spec/unit/plugins/windows/filesystem_spec.rb2
-rw-r--r--spec/unit/plugins/windows/kernel_spec.rb2
-rw-r--r--spec/unit/plugins/windows/memory_spec.rb2
-rw-r--r--spec/unit/plugins/windows/network_spec.rb2
-rw-r--r--spec/unit/util/ip_helper_spec.rb2
9 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/plugins/cloud_spec.rb b/spec/unit/plugins/cloud_spec.rb
index d805c93c..c8f24e7c 100644
--- a/spec/unit/plugins/cloud_spec.rb
+++ b/spec/unit/plugins/cloud_spec.rb
@@ -16,7 +16,7 @@
#
require "spec_helper"
-require "ipaddr"
+require "ipaddr" unless defined?(IPAddr)
describe "CloudAttrs object" do
before do
diff --git a/spec/unit/plugins/hostname_spec.rb b/spec/unit/plugins/hostname_spec.rb
index c7e00f8b..ce672ebd 100644
--- a/spec/unit/plugins/hostname_spec.rb
+++ b/spec/unit/plugins/hostname_spec.rb
@@ -17,7 +17,7 @@
#
require "spec_helper"
-require "wmi-lite/wmi"
+require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
require "socket"
describe Ohai::System, "hostname plugin" do
diff --git a/spec/unit/plugins/linux/network_spec.rb b/spec/unit/plugins/linux/network_spec.rb
index 70b1ec45..5ee364c0 100644
--- a/spec/unit/plugins/linux/network_spec.rb
+++ b/spec/unit/plugins/linux/network_spec.rb
@@ -18,7 +18,7 @@
#
require "spec_helper"
-require "ipaddress"
+require "ipaddress" unless defined?(IPAddress)
describe Ohai::System, "Linux Network Plugin" do
let(:plugin) { get_plugin("linux/network") }
diff --git a/spec/unit/plugins/windows/dmi_spec.rb b/spec/unit/plugins/windows/dmi_spec.rb
index f9f1c16d..aa086611 100644
--- a/spec/unit/plugins/windows/dmi_spec.rb
+++ b/spec/unit/plugins/windows/dmi_spec.rb
@@ -22,7 +22,7 @@ describe Ohai::System, "DMI", :windows_only do
let(:plugin) { get_plugin("windows/dmi") }
before do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
empty_wmi_object = WmiLite::Wmi::Instance.new(double(properties_: []))
%w{Processor Bios ComputerSystemProduct BaseBoard}.each do |type|
diff --git a/spec/unit/plugins/windows/filesystem_spec.rb b/spec/unit/plugins/windows/filesystem_spec.rb
index 7082259b..396eb300 100644
--- a/spec/unit/plugins/windows/filesystem_spec.rb
+++ b/spec/unit/plugins/windows/filesystem_spec.rb
@@ -17,7 +17,7 @@
#
require "spec_helper"
-require "wmi-lite/wmi"
+require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
describe Ohai::System, "Windows Filesystem Plugin", :windows_only do
let(:plugin) { get_plugin("filesystem") }
diff --git a/spec/unit/plugins/windows/kernel_spec.rb b/spec/unit/plugins/windows/kernel_spec.rb
index 6127848c..342b7423 100644
--- a/spec/unit/plugins/windows/kernel_spec.rb
+++ b/spec/unit/plugins/windows/kernel_spec.rb
@@ -21,7 +21,7 @@ describe Ohai::System, "Windows kernel plugin", :windows_only do
let(:plugin) { get_plugin("kernel") }
before do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
# Mock a Win32_OperatingSystem OLE32 WMI object
caption = double("WIN32OLE", name: "Caption")
diff --git a/spec/unit/plugins/windows/memory_spec.rb b/spec/unit/plugins/windows/memory_spec.rb
index 38e88eda..bc788b86 100644
--- a/spec/unit/plugins/windows/memory_spec.rb
+++ b/spec/unit/plugins/windows/memory_spec.rb
@@ -18,7 +18,7 @@ require "spec_helper"
describe Ohai::System, "Windows memory plugin", :windows_only do
before do
- require "wmi-lite/wmi"
+ require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
@plugin = get_plugin("windows/memory")
mock_os = {
"TotalVisibleMemorySize" => "10485760",
diff --git a/spec/unit/plugins/windows/network_spec.rb b/spec/unit/plugins/windows/network_spec.rb
index ff732cc7..38d2c17a 100644
--- a/spec/unit/plugins/windows/network_spec.rb
+++ b/spec/unit/plugins/windows/network_spec.rb
@@ -17,7 +17,7 @@
#
require "spec_helper"
-require "ipaddress"
+require "ipaddress" unless defined?(IPAddress)
describe Ohai::System, "Windows Network Plugin" do
let(:plugin) { get_plugin("windows/network") }
diff --git a/spec/unit/util/ip_helper_spec.rb b/spec/unit/util/ip_helper_spec.rb
index ec9b37ba..4bc4a7b6 100644
--- a/spec/unit/util/ip_helper_spec.rb
+++ b/spec/unit/util/ip_helper_spec.rb
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "ipaddress"
+require "ipaddress" unless defined?(IPAddress)
require "spec_helper"
require "ohai/util/ip_helper"