summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 1d6d8b87..4e88a52f 100644
--- a/spec/unit/system_spec.rb
+++ b/spec/unit/system_spec.rb
@@ -18,6 +18,7 @@
#
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
+require 'ohai/mixin/os'
describe "Ohai::System" do
extend IntegrationSupport
@@ -216,6 +217,28 @@ EOF
end
end
+ when_plugins_directory "contains a v7 plugins with :default and platform specific blocks" do
+ with_plugin("message.rb", <<EOF)
+Ohai.plugin(:Message) do
+ provides 'message'
+
+ collect_data(:default) do
+ message("default")
+ end
+
+ collect_data(:#{Ohai::Mixin::OS.collect_os}) do
+ message("platform_specific_message")
+ end
+end
+EOF
+
+ it "should collect platform specific" do
+ Ohai::Config[:plugin_path] = [ path_to(".") ]
+ @ohai.all_plugins
+ @ohai.data[:message].should == "platform_specific_message"
+ end
+ end
+
when_plugins_directory "contains v7 plugins only" do
with_plugin("zoo.rb", <<EOF)
Ohai.plugin(:Zoo) do