summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-10-10 11:54:09 -0700
committerTim Smith <tsmith@chef.io>2018-12-22 21:26:55 -0800
commit75db51a20e5dbf4dfe0e83b8e861a5acdc508cc8 (patch)
tree4146253c6311bce06aeb6946a5f7458fa9043691
parentd0953705a8e7f232f37ca4f905de7e7d6cc69b72 (diff)
downloadohai-loader_fixup.tar.gz
Rename the load_plugin method to load_plugin_for_testsloader_fixup
This exists just for rspec. We should probably just monkey patch this in via rspec. It's :( to have a method that's just for test execution. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/loader.rb2
-rw-r--r--spec/spec_helper.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/ohai/loader.rb b/lib/ohai/loader.rb
index 17d969ef..1f1b351b 100644
--- a/lib/ohai/loader.rb
+++ b/lib/ohai/loader.rb
@@ -85,7 +85,7 @@ module Ohai
# purposes.
#
# @param plugin_path [String]
- def load_plugin(plugin_path)
+ def load_plugin_for_tests(plugin_path)
plugin_class = load_plugin_class_from_file(plugin_path)
return nil unless plugin_class.kind_of?(Class)
if plugin_class < Ohai::DSL::Plugin::VersionVII
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 94bdffc6..1c791ca0 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -28,7 +28,7 @@ end
def get_plugin(plugin, ohai = Ohai::System.new, path = PLUGIN_PATH)
loader = Ohai::Loader.new(ohai)
- loader.load_plugin(File.join(path, "#{plugin}.rb"))
+ loader.load_plugin_for_tests(File.join(path, "#{plugin}.rb"))
end
def convert_windows_output(stdout)