diff options
author | Daniel DeLeo <dan@opscode.com> | 2011-03-23 09:06:50 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2011-03-23 09:06:50 -0700 |
commit | 53de4e9c3c5b871762aec93f6093ea9950bff4ca (patch) | |
tree | 03e776c4f384861e64c9fff94880a2e8d1c8301c /spec/spec_helper.rb | |
parent | c36e9813dc16e7220d64296a29c29a59685baa15 (diff) | |
download | ohai-53de4e9c3c5b871762aec93f6093ea9950bff4ca.tar.gz |
upgrade ohai to rspec2, fix Rakefile
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 477ffefd..a7f94739 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,12 +1,4 @@ -begin - require 'spec' - require 'mixlib/config' -rescue LoadError - require 'rubygems' - gem 'rspec' - require 'spec' - require 'mixlib/config' -end +require 'mixlib/config' $:.unshift(File.dirname(__FILE__) + '/../lib') require 'ohai' @@ -24,7 +16,7 @@ def it_should_check_from_mash(plugin, attribute, from, value) @ohai.should_receive(:from).with(from).and_return(value) @ohai._require_plugin(plugin) end - + it "should set the #{plugin}[:#{attribute}] to the value from '#{from}'" do @ohai._require_plugin(plugin) @ohai[plugin][attribute].should == value @@ -37,13 +29,13 @@ def it_should_check_from_deep_mash(plugin, mash, attribute, from, value) @ohai.should_receive(:from).with(from).and_return(value) @ohai._require_plugin(plugin) end - + it "should set the #{mash.inspect}[:#{attribute}] to the value from '#{from}'" do @ohai._require_plugin(plugin) - if mash.is_a?(String) + if mash.is_a?(String) @ohai[mash][attribute].should == value elsif mash.is_a?(Array) - if mash.length == 2 + if mash.length == 2 @ohai[mash[0]][mash[1]][attribute].should == value elsif mash.length == 3 @ohai[mash[0]][mash[1]][mash[2]][attribute].should == value |