2013-02-03 18:25:53 +01:00
|
|
|
require 'puppetlabs_spec_helper/module_spec_helper'
|
|
|
|
|
2013-02-10 01:36:12 +01:00
|
|
|
RSpec.configure do |c|
|
2013-07-19 20:51:58 +02:00
|
|
|
c.mock_with :rspec do |mock|
|
|
|
|
mock.syntax = [:expect, :should]
|
|
|
|
end
|
2013-02-10 01:36:12 +01:00
|
|
|
c.include PuppetlabsSpec::Files
|
|
|
|
|
|
|
|
c.before :each do
|
2013-02-03 18:25:53 +01:00
|
|
|
# Store any environment variables away to be restored later
|
|
|
|
@old_env = {}
|
|
|
|
ENV.each_key {|k| @old_env[k] = ENV[k]}
|
2014-04-08 16:38:31 +02:00
|
|
|
|
|
|
|
if ENV['STRICT_VARIABLES'] == 'yes'
|
|
|
|
Puppet.settings[:strict_variables]=true
|
|
|
|
end
|
2013-02-03 18:25:53 +01:00
|
|
|
end
|
2013-02-10 01:36:12 +01:00
|
|
|
|
|
|
|
c.after :each do
|
|
|
|
PuppetlabsSpec::Files.cleanup
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Convenience helper for returning parameters for a type from the
|
|
|
|
# catalogue.
|
|
|
|
def param(type, title, param)
|
|
|
|
param_value(catalogue, type, title, param)
|
2013-02-03 18:25:53 +01:00
|
|
|
end
|
2014-07-09 18:04:43 +02:00
|
|
|
|
2014-07-09 22:37:29 +02:00
|
|
|
# With rspec-puppet v2.0 this allows coverage checks.
|
|
|
|
#at_exit { RSpec::Puppet::Coverage.report! }
|