diff options
author | David Schmitt <david.schmitt@puppetlabs.com> | 2015-06-01 12:21:59 +0100 |
---|---|---|
committer | David Schmitt <david.schmitt@puppetlabs.com> | 2015-06-01 12:21:59 +0100 |
commit | b62dff0c6e09faf9bacfb02575e689ed09ee5e56 (patch) | |
tree | f7233b6328f82f4affed6d2eaea73aa0f3c22cc4 | |
parent | 78bd9c8cbea75ae21ca7403d19ff952f77617585 (diff) | |
download | puppet-stdlib-b62dff0c6e09faf9bacfb02575e689ed09ee5e56.tar.gz puppet-stdlib-b62dff0c6e09faf9bacfb02575e689ed09ee5e56.tar.bz2 |
spec_helper: implement an easy way for specs to confine to puppet version
Usage:
describe 'puppet3 behaviour', :unless => RSpec.configuration.puppet_future do
describe 'puppet4 behaviour', :if => RSpec.configuration.puppet_future do
-rwxr-xr-x | spec/spec_helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ccc4d95..be392fd 100755 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,6 +23,10 @@ require 'mocha/api' RSpec::Mocks::Syntax.enable_expect(RSpec::Puppet::ManifestMatchers) RSpec.configure do |config| + config.add_setting :puppet_future + #config.puppet_future = (ENV['FUTURE_PARSER'] == 'yes' or Puppet.version.to_f >= 4.0) + config.puppet_future = Puppet.version.to_f >= 4.0 + 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 |