Updated mcollective.init according to OSCI-658
[packages/precise/mcollective.git] / spec / spec_helper.rb
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644 (file)
index 0000000..81193ab
--- /dev/null
@@ -0,0 +1,33 @@
+dir = File.expand_path(File.dirname(__FILE__))
+$LOAD_PATH.unshift("#{dir}/")
+$LOAD_PATH.unshift("#{dir}/../lib")
+$LOAD_PATH.unshift("#{dir}/../plugins")
+
+require 'rubygems'
+
+gem 'mocha'
+
+require 'rspec'
+require 'mcollective'
+require 'rspec/mocks'
+require 'mocha'
+require 'ostruct'
+require 'tmpdir'
+require 'tempfile'
+require 'fileutils'
+
+require 'monkey_patches/instance_variable_defined'
+require 'matchers/exception_matchers'
+
+RSpec.configure do |config|
+  config.mock_with :mocha
+  config.include(MCollective::Matchers)
+
+  config.before :each do
+    MCollective::Config.instance.set_config_defaults("")
+    MCollective::PluginManager.clear
+    MCollective::Log.stubs(:log)
+    MCollective::Log.stubs(:logmsg)
+    MCollective::Log.stubs(:logexception)
+  end
+end