diff options
Diffstat (limited to 'spec/unit/system_spec.rb')
-rw-r--r-- | spec/unit/system_spec.rb | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/spec/unit/system_spec.rb b/spec/unit/system_spec.rb index a5b58232..3e704df3 100644 --- a/spec/unit/system_spec.rb +++ b/spec/unit/system_spec.rb @@ -305,73 +305,6 @@ EOF end end - describe "when refreshing plugins" do - when_plugins_directory "contains v7 plugins" do - with_plugin("desired.rb", <<-E) - Ohai.plugin(:DesiredPlugin) do - provides 'desired_attr' - depends 'depended_attr' - - collect_data do - desired_attr "hello" - self[:desired_attr_count] ||= 0 - self[:desired_attr_count] += 1 - end - end - E - - with_plugin("depended.rb", <<-E) - Ohai.plugin(:DependedPlugin) do - provides 'depended_attr' - - collect_data do - depended_attr "hello" - self[:depended_attr_count] ||= 0 - self[:depended_attr_count] += 1 - end - end - E - - with_plugin("other.rb", <<-E) - Ohai.plugin(:OtherPlugin) do - provides 'other_attr' - - collect_data do - other_attr "hello" - self[:other_attr_count] ||= 0 - self[:other_attr_count] += 1 - end - end - E - - before do - Ohai.config[:plugin_path] = [ path_to(".") ] - Ohai::Log.init(STDOUT) - Ohai::Log.level = :debug - ohai.all_plugins - end - - it "should rerun the plugin providing the desired attributes" do - expect(ohai.data[:desired_attr_count]).to eq(1) - ohai.refresh_plugins("desired_attr") - expect(ohai.data[:desired_attr_count]).to eq(2) - end - - it "should not re-run dependencies of the plugin providing the desired attributes" do - expect(ohai.data[:depended_attr_count]).to eq(1) - ohai.refresh_plugins("desired_attr") - expect(ohai.data[:depended_attr_count]).to eq(1) - end - - it "should not re-run plugins unrelated to the plugin providing the desired attributes" do - expect(ohai.data[:other_attr_count]).to eq(1) - ohai.refresh_plugins("desired_attr") - expect(ohai.data[:other_attr_count]).to eq(1) - end - - end - end - describe "when running ohai for specific attributes" do when_plugins_directory "contains v7 plugins" do with_plugin("languages.rb", <<-E) |