summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-10 12:02:31 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-10 12:02:31 -0700
commitbabfaa403de3617afdb0a87590b907023a3bdc47 (patch)
tree6d637627046965b7b563258048cedd232fadc10e
parent4451b242ba4988ba17f481d7ed1d1461951987dd (diff)
downloadohai-remove_requires.tar.gz
Remove non-Ohai requires from specs to prevent false positivesremove_requires
The plugins should require everything they need unless we're using those library to mock out objects like we do in some Windows specs. This way we rely on the requires in the plugins and specs fail if those requires are removed. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/unit/plugins/azure_spec.rb1
-rw-r--r--spec/unit/plugins/chef_spec.rb1
-rw-r--r--spec/unit/plugins/cloud_spec.rb1
-rw-r--r--spec/unit/plugins/ec2_spec.rb2
-rw-r--r--spec/unit/plugins/hostname_spec.rb2
-rw-r--r--spec/unit/plugins/windows/network_spec.rb1
-rw-r--r--spec/unit/util/ip_helper_spec.rb1
7 files changed, 0 insertions, 9 deletions
diff --git a/spec/unit/plugins/azure_spec.rb b/spec/unit/plugins/azure_spec.rb
index f11a2b9b..6d489eb3 100644
--- a/spec/unit/plugins/azure_spec.rb
+++ b/spec/unit/plugins/azure_spec.rb
@@ -17,7 +17,6 @@
#
require "spec_helper"
-require "open-uri"
describe Ohai::System, "plugin azure" do
let(:plugin) { get_plugin("azure") }
diff --git a/spec/unit/plugins/chef_spec.rb b/spec/unit/plugins/chef_spec.rb
index 1596e152..8ee4ff95 100644
--- a/spec/unit/plugins/chef_spec.rb
+++ b/spec/unit/plugins/chef_spec.rb
@@ -20,7 +20,6 @@
begin
require "spec_helper"
- require "chef/version"
describe Ohai::System, "plugin chef" do
before do
diff --git a/spec/unit/plugins/cloud_spec.rb b/spec/unit/plugins/cloud_spec.rb
index c8f24e7c..f71a7dd3 100644
--- a/spec/unit/plugins/cloud_spec.rb
+++ b/spec/unit/plugins/cloud_spec.rb
@@ -16,7 +16,6 @@
#
require "spec_helper"
-require "ipaddr" unless defined?(IPAddr)
describe "CloudAttrs object" do
before do
diff --git a/spec/unit/plugins/ec2_spec.rb b/spec/unit/plugins/ec2_spec.rb
index 823d5ed3..4d6b48b2 100644
--- a/spec/unit/plugins/ec2_spec.rb
+++ b/spec/unit/plugins/ec2_spec.rb
@@ -18,8 +18,6 @@
#
require "spec_helper"
-require "open-uri"
-require "base64"
describe Ohai::System, "plugin ec2" do
diff --git a/spec/unit/plugins/hostname_spec.rb b/spec/unit/plugins/hostname_spec.rb
index ce672ebd..b6202e18 100644
--- a/spec/unit/plugins/hostname_spec.rb
+++ b/spec/unit/plugins/hostname_spec.rb
@@ -17,8 +17,6 @@
#
require "spec_helper"
-require "wmi-lite/wmi" unless defined?(WmiLite::Wmi)
-require "socket"
describe Ohai::System, "hostname plugin" do
before do
diff --git a/spec/unit/plugins/windows/network_spec.rb b/spec/unit/plugins/windows/network_spec.rb
index 38d2c17a..7c0e5cc6 100644
--- a/spec/unit/plugins/windows/network_spec.rb
+++ b/spec/unit/plugins/windows/network_spec.rb
@@ -17,7 +17,6 @@
#
require "spec_helper"
-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 4bc4a7b6..1ea144d0 100644
--- a/spec/unit/util/ip_helper_spec.rb
+++ b/spec/unit/util/ip_helper_spec.rb
@@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "ipaddress" unless defined?(IPAddress)
require "spec_helper"
require "ohai/util/ip_helper"