spec/spec_helper.rb in ohai-6.14.0 vs spec/spec_helper.rb in ohai-6.16.0.beta.1
- old
+ new
@@ -1,9 +1,11 @@
require 'rspec'
-require 'mixlib/config'
+$:.unshift(File.expand_path("../..", __FILE__))
$:.unshift(File.dirname(__FILE__) + '/../lib')
+
+require 'spec/support/platform_helpers'
require 'ohai'
Ohai::Config[:log_level] = :error
def it_should_check_from(plugin, attribute, from, value)
it "should set the #{attribute} to the value from '#{from}'" do
@@ -51,6 +53,17 @@
module SimpleFromFile
def from_file(filename)
self.instance_eval(IO.read(filename), filename, 1)
end
+end
+
+RSpec.configure do |config|
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+
+ config.filter_run_excluding :windows_only => true unless windows?
+ config.filter_run_excluding :unix_only => true unless unix?
+ config.filter_run_excluding :ruby_18_only => true unless ruby_18?
+ config.filter_run_excluding :ruby_19_only => true unless ruby_19?
+ config.filter_run_excluding :requires_root => true unless ENV['USER'] == 'root'
+ config.filter_run_excluding :requires_unprivileged_user => true if ENV['USER'] == 'root'
end