Created
April 18, 2015 01:50
-
-
Save trevor-vaughan/10d66c0a3db718fb5e7b to your computer and use it in GitHub Desktop.
spec_helper.rb snippet for custom environments in rspec-puppet tests.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'puppetlabs_spec_helper/module_spec_helper' | |
def set_environment(environment = :production) | |
RSpec.configure { |config| config.default_facts['environment'] = environment.to_s } | |
end | |
RSpec.configure do |config| | |
config.before(:each) do | |
if defined?(environment) | |
set_environment(environment) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment