summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2011-03-23 09:06:50 -0700
committerDaniel DeLeo <dan@opscode.com>2011-03-23 09:06:50 -0700
commit53de4e9c3c5b871762aec93f6093ea9950bff4ca (patch)
tree03e776c4f384861e64c9fff94880a2e8d1c8301c /spec/spec_helper.rb
parentc36e9813dc16e7220d64296a29c29a59685baa15 (diff)
downloadohai-53de4e9c3c5b871762aec93f6093ea9950bff4ca.tar.gz
upgrade ohai to rspec2, fix Rakefile
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb18
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