summaryrefslogtreecommitdiff
path: root/spec/unit/system_spec.rb
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-12-16 14:54:27 -0800
committersersut <serdar@opscode.com>2013-12-17 14:09:47 -0800
commit9dbe6a2e71bc9946713e6afc02fc9884add221f6 (patch)
tree70b9fbd8a26b397e5aa2bbbd34abf55ed0e89ecd /spec/unit/system_spec.rb
parent9915bf8d23ccb83f2944e41c88163f49b7fb7965 (diff)
downloadohai-9dbe6a2e71bc9946713e6afc02fc9884add221f6.tar.gz
Handle AttributeNotFound exception correctly.
Diffstat (limited to 'spec/unit/system_spec.rb')
-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 c07ed836..1d6d8b87 100644
--- a/spec/unit/system_spec.rb
+++ b/spec/unit/system_spec.rb
@@ -390,5 +390,28 @@ EOF
end
end
+ when_plugins_directory "a v6 plugin that requires non-existing v7 plugin" do
+ with_plugin("message.rb", <<EOF)
+provides 'message'
+
+require_plugin 'v7message'
+
+message v7message
+EOF
+
+ before do
+ @ohai = Ohai::System.new
+ @original_config = Ohai::Config[:plugin_path]
+ Ohai::Config[:plugin_path] = [ path_to(".") ]
+ end
+
+ after do
+ Ohai::Config[:plugin_path] = @original_config
+ end
+
+ it "should raise DependencyNotFound" do
+ lambda { @ohai.all_plugins }.should raise_error(Ohai::Exceptions::DependencyNotFound)
+ end
+ end
end
end