From 6bd87535749c11d3a519677b9a6c88b4330e962b Mon Sep 17 00:00:00 2001 From: Daniel Lawrence Date: Sun, 27 Jul 2014 19:42:03 +1000 Subject: started adding spec tests --- spec_helper.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec_helper.rb (limited to 'spec_helper.rb') diff --git a/spec_helper.rb b/spec_helper.rb new file mode 100644 index 0000000..65379ee --- /dev/null +++ b/spec_helper.rb @@ -0,0 +1,25 @@ +require 'puppetlabs_spec_helper/module_spec_helper' + +RSpec.configure do |c| + c.treat_symbols_as_metadata_keys_with_true_values = true + + c.before :each do + # Ensure that we don't accidentally cache facts and environment + # between test cases. + Facter::Util::Loader.any_instance.stubs(:load_all) + Facter.clear + Facter.clear_messages + + # Store any environment variables away to be restored later + @old_env = {} + ENV.each_key {|k| @old_env[k] = ENV[k]} + + if ENV['STRICT_VARIABLES'] == 'yes' + Puppet.settings[:strict_variables]=true + end + end +end + +shared_examples :compile, :compile => true do + it { should compile.with_all_deps } +end -- cgit v1.2.3