diff options
author | danielsdeleo <dan@getchef.com> | 2014-04-09 11:34:06 -0700 |
---|---|---|
committer | danielsdeleo <dan@getchef.com> | 2014-04-09 11:34:58 -0700 |
commit | 594264998dd3fd9fd36164c2b26a907c6a193804 (patch) | |
tree | d997df45f5e410a061e7d7b182aec8ac9a9125fb /spec | |
parent | 189aace71e4af28ca2a5a2e93dbb0552c3760914 (diff) | |
download | ohai-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.rb | 23 |
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 |