summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorJeff McCune <jeff@puppetlabs.com>2012-10-25 12:01:01 -0700
committerJeff McCune <jeff@puppetlabs.com>2012-10-25 12:01:01 -0700
commit4004a758b0c01ac17206a838f91f8cf5c57cc466 (patch)
tree4304339b93ca5a0ac044fc43add0b00f3378e0ec /spec/spec_helper.rb
parentfb8993bf48ba6e6baeb1f2b1987262a287285965 (diff)
parent1d371ab8b67b85d52f8c4932f78660de8a236b93 (diff)
Merge branch '3.1.x' into 3.x
* 3.1.x: Update Modulefile, CHANGELOG for 3.1.0 Revert "Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'""" Update Modulefile, CHANGELOG for 2.5.0 Explicitly load functions used by ensure_resource re-formatting Add better docs about duplicate resource failures Handle undef for parameter argument Add function ensure_resource and defined_with_params Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"" Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"" Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x" Prevent undefined method `split' for nil:NilClass with pe_foo_version facts (maint) Clear all facts before each example Add spec tests for pe_version facts Add PE facts to stdlib Fix some logical inconsistencies in README (#14422) Update README to include the bug tracker URL. Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'""
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index e269b90..931d35c 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -11,3 +11,18 @@ gem 'rspec', '>=2.0.0'
require 'rspec/expectations'
require 'puppetlabs_spec_helper/module_spec_helper'
+
+RSpec.configure do |config|
+ # FIXME REVISIT - We may want to delegate to Facter like we do in
+ # Puppet::PuppetSpecInitializer.initialize_via_testhelper(config) because
+ # this behavior is a duplication of the spec_helper in Facter.
+ config.before :each do
+ # Ensure that we don't accidentally cache facts and environment between
+ # test cases. This requires each example group to explicitly load the
+ # facts being exercised with something like
+ # Facter.collection.loader.load(:ipaddress)
+ Facter::Util::Loader.any_instance.stubs(:load_all)
+ Facter.clear
+ Facter.clear_messages
+ end
+end