summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2014-04-09 11:34:06 -0700
committerdanielsdeleo <dan@getchef.com>2014-04-09 11:34:58 -0700
commit594264998dd3fd9fd36164c2b26a907c6a193804 (patch)
treed997df45f5e410a061e7d7b182aec8ac9a9125fb /spec
parent189aace71e4af28ca2a5a2e93dbb0552c3760914 (diff)
downloadohai-594264998dd3fd9fd36164c2b26a907c6a193804.tar.gz
Skip v7 plugins when refreshing a v6 plugin
Fixes OHAI-562
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/system_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb
index 0ab66ab4..d452447a 100644
--- a/spec/unit/system_spec.rb
+++ b/spec/unit/system_spec.rb
@@ -517,6 +517,29 @@ EOF
end
describe "when Chef OHAI resource executes :reload action" do
+
+ when_plugins_directory "contains a v6 plugin" do
+ with_plugin("a_v6plugin.rb", <<-E)
+ plugin_data Mash.new
+ plugin_data[:foo] = :bar
+ E
+
+ before do
+ @original_config = Ohai::Config[:plugin_path]
+ Ohai::Config[:plugin_path] = [ path_to(".") ]
+ end
+
+ after do
+ Ohai::Config[:plugin_path] = @original_config
+ end
+
+ it "reloads only the v6 plugin when given a specific plugin to load" do
+ ohai.all_plugins
+ lambda { ohai.all_plugins("a_v6plugin") }.should_not raise_error
+ end
+
+ end
+
when_plugins_directory "contains a random plugin" do
with_plugin("random.rb", <<-E)
Ohai.plugin(:Random) do