Don't push incoming to klecker
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / spec_helper.rb
1 #! /usr/bin/env ruby -S rspec
2 dir = File.expand_path(File.dirname(__FILE__))
3 $LOAD_PATH.unshift File.join(dir, 'lib')
4
5 # So everyone else doesn't have to include this base constant.
6 module PuppetSpec
7   FIXTURE_DIR = File.join(dir = File.expand_path(File.dirname(__FILE__)), "fixtures") unless defined?(FIXTURE_DIR)
8 end
9
10 require 'puppet'
11 require 'rspec-puppet'
12 require 'puppetlabs_spec_helper/module_spec_helper'
13 require 'puppet_spec/verbose'
14 require 'puppet_spec/files'
15 require 'puppet_spec/settings'
16 require 'puppet_spec/fixtures'
17 require 'puppet_spec/matchers'
18 require 'puppet_spec/database'
19 require 'monkey_patches/alias_should_to_must'
20 require 'mocha/setup'
21
22
23
24 RSpec.configure do |config|
25   config.before :each do
26     # Ensure that we don't accidentally cache facts and environment between
27     # test cases.  This requires each example group to explicitly load the
28     # facts being exercised with something like
29     # Facter.collection.loader.load(:ipaddress)
30     Facter::Util::Loader.any_instance.stubs(:load_all)
31     Facter.clear
32     Facter.clear_messages
33   end
34 end