summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@opscode.com>2012-12-06 14:29:47 -0800
committerBryan McLellan <btm@opscode.com>2012-12-06 14:30:25 -0800
commit23c6a3101aac992ec8657e924aed2d3be7f0f803 (patch)
tree3c7bf87cc6b3d762ebd2a161527c153fd9c4eac6
parentfb1c5ab1368b88be6db2ab50afea2339599c0851 (diff)
downloadohai-23c6a3101aac992ec8657e924aed2d3be7f0f803.tar.gz
OHAI-395: Fail obviously if we can't load plist
-rw-r--r--spec/ohai/plugins/darwin/system_profiler_spec.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/ohai/plugins/darwin/system_profiler_spec.rb b/spec/ohai/plugins/darwin/system_profiler_spec.rb
index cc892415..6f8207f1 100644
--- a/spec/ohai/plugins/darwin/system_profiler_spec.rb
+++ b/spec/ohai/plugins/darwin/system_profiler_spec.rb
@@ -19,6 +19,13 @@
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
require File.expand_path("#{File.dirname(__FILE__)}/system_profiler_output.rb")
+begin
+ require 'plist'
+rescue LoadError => e
+ puts "The darwin systemprofile plugin spec tests will fail without the 'plist' library/gem.\n\n"
+ raise e
+end
+
describe Ohai::System, "Darwin system_profiler plugin" do
before(:each) do
@ohai = Ohai::System.new
@@ -39,4 +46,4 @@ describe Ohai::System, "Darwin system_profiler plugin" do
@ohai._require_plugin("darwin::system_profiler")
@ohai['system_profile'][18]["_items"][0]["serial_number"].should == 'ABCDEFG12345'
end
-end \ No newline at end of file
+end