diff options
author | Bryan McLellan <btm@opscode.com> | 2012-11-13 13:39:26 -0800 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2012-11-13 13:42:33 -0800 |
commit | 7a101ee0ebe152245af475ba3070b15e768a8754 (patch) | |
tree | 2e10ec643bf21df00261131f484ccccf26cadd90 | |
parent | 33727d357c13d0a2a7a04cdf43cf2c5f9f96a22f (diff) | |
download | ohai-7a101ee0ebe152245af475ba3070b15e768a8754.tar.gz |
require chef in the plugin check for chef
Perhaps inadvertently removed?
It already has a LoadError around it. Add pending tests for vebosity though.
-rw-r--r-- | spec/ohai/plugins/chef_spec.rb | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/spec/ohai/plugins/chef_spec.rb b/spec/ohai/plugins/chef_spec.rb index 3acfe469..01c123dd 100644 --- a/spec/ohai/plugins/chef_spec.rb +++ b/spec/ohai/plugins/chef_spec.rb @@ -19,19 +19,28 @@ # begin -require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb') - -describe Ohai::System, "plugin chef" do - before(:each) do - @ohai = Ohai::System.new - @ohai.stub!(:require_plugin).and_return(true) - end + require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb') + + require 'chef' + + describe Ohai::System, "plugin chef" do + before(:each) do + @ohai = Ohai::System.new + @ohai.stub!(:require_plugin).and_return(true) + end + + it "should set [:chef_packages][:chef][:version] to the current chef version", :if => defined?(Chef) do + @ohai._require_plugin("chef") + @ohai[:chef_packages][:chef][:version].should == Chef::VERSION + end + + pending "would set [:chef_packages][:chef][:version] if chef was available", :unless => defined?(Chef) - it "should set [:chef_packages][:chef][:version] to the current chef version" do - @ohai._require_plugin("chef") - @ohai[:chef_packages][:chef][:version].should == Chef::VERSION end -end rescue LoadError # the chef module is not available, ignoring. + + describe Ohai::System, "plugin chef" do + pending "would set [:chef_packages][:chef][:version] if chef was available", :unless => defined?(Chef) + end end |