summaryrefslogtreecommitdiff
path: root/spec/mixlib/authentication/mixlib_authentication_spec.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-21 11:06:42 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-21 11:06:42 -0700
commit22f6e84d34eecf8d478c49f9f3369d2b71933a27 (patch)
tree589f69f80f71a5e8cfce326214f7d1a388d4481c /spec/mixlib/authentication/mixlib_authentication_spec.rb
parentd3e3be2979fe9036cd478857952281540afa36f2 (diff)
downloadmixlib-authentication-22f6e84d34eecf8d478c49f9f3369d2b71933a27.tar.gz
Optimize our requires
Avoid requiring things that are already defined. Rubygems is very slow at traversing the filesystem. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/mixlib/authentication/mixlib_authentication_spec.rb')
-rw-r--r--spec/mixlib/authentication/mixlib_authentication_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/mixlib/authentication/mixlib_authentication_spec.rb b/spec/mixlib/authentication/mixlib_authentication_spec.rb
index 5a17d5c..b679208 100644
--- a/spec/mixlib/authentication/mixlib_authentication_spec.rb
+++ b/spec/mixlib/authentication/mixlib_authentication_spec.rb
@@ -20,13 +20,13 @@
#
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_helper"))
-require "rubygems"
+require "rubygems" unless defined?(Gem)
-require "ostruct"
-require "openssl"
+require "ostruct" unless defined?(OpenStruct)
+require "openssl" unless defined?(OpenSSL)
require "mixlib/authentication/signatureverification"
-require "time"
-require "net/ssh"
+require "time" unless defined?(Time)
+require "net/ssh" unless defined?(Net::SSH)
# TODO: should make these regular spec-based mock objects.
class MockRequest