From 3330523b955e93205f60b5b7d13ed50500b7069f Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Fri, 16 Sep 2016 12:47:31 -0400 Subject: [PATCH] Update to use new rspec-puppet-facts version --- config_defaults.yml | 2 ++ moduleroot/.travis.yml | 14 +++++++------- moduleroot/Gemfile | 2 -- moduleroot/spec/spec_helper.rb | 6 ++++++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/config_defaults.yml b/config_defaults.yml index d78b83e..ba0dca0 100644 --- a/config_defaults.yml +++ b/config_defaults.yml @@ -55,6 +55,8 @@ Gemfile: groups: - 'test' - gem: metadata-json-lint + - gem: rspec-puppet-facts + version: '>= 1.7' .puppet-lint.rc: default_disabled_lint_checks: - '140chars' diff --git a/moduleroot/.travis.yml b/moduleroot/.travis.yml index 46424bf..a1f4ec3 100644 --- a/moduleroot/.travis.yml +++ b/moduleroot/.travis.yml @@ -6,26 +6,26 @@ rvm: - 2.0.0 - 2.1.5 env: - - PUPPET_VERSION=3.5 - - PUPPET_VERSION=3.5 FUTURE_PARSER=yes - - PUPPET_VERSION=4.0 + - PUPPET_VERSION=3.5 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64 + - PUPPET_VERSION=3.5 FUTURE_PARSER=yes ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64 + - PUPPET_VERSION=4.0 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64 matrix: fast_finish: true exclude: # No support for Ruby 1.9.3 on Puppet 4.x - rvm: 1.9.3 - env: PUPPET_VERSION=4.0 + env: PUPPET_VERSION=4.0 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64 include: # Only platforms left to support ruby 1.8.7 - rvm: 1.8.7 - env: PUPPET_VERSION=3.5 + env: PUPPET_VERSION=3.5 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64 - rvm: 1.8.7 env: PUPPET_VERSION=3.5 FUTURE_PARSER=yes # Only Puppet 4.x supports Ruby 2.2. Also limit the OS set we test Ruby 2.2 with. - rvm: 2.2.3 - env: PUPPET_VERSION=4.0 + env: PUPPET_VERSION=4.0 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64 # Only Puppet >= 4.4 supports Ruby 2.3. Also limit the OS set we test Ruby 2.3 with. - rvm: 2.3.0 - env: PUPPET_VERSION=4.4 + env: PUPPET_VERSION=4.4 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64 bundler_args: --without development sudo: false diff --git a/moduleroot/Gemfile b/moduleroot/Gemfile index a4509dd..ee750c4 100644 --- a/moduleroot/Gemfile +++ b/moduleroot/Gemfile @@ -8,11 +8,9 @@ gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '~> 3 if RUBY_VERSION.start_with? '1.8' gem 'rake', '< 11' gem 'rspec', '>= 3', '< 3.2' - gem 'rspec-puppet-facts', '< 1.4.0' else gem 'rake' gem 'rspec', '~> 3.0' - gem 'rspec-puppet-facts', '>= 1.5' end <% (@configs['required'] + (@configs['extra'] || [])).each do |gem| -%> gem '<%= gem['gem'] %>'<%= ", '#{gem['version']}'" if gem['version'] %><%= ", #{gem['options'].inspect}" if gem['options'] %> diff --git a/moduleroot/spec/spec_helper.rb b/moduleroot/spec/spec_helper.rb index 6361074..d0f74f1 100644 --- a/moduleroot/spec/spec_helper.rb +++ b/moduleroot/spec/spec_helper.rb @@ -9,6 +9,12 @@ require 'rspec-puppet-facts' include RspecPuppetFacts + # Original fact sources: +add_custom_fact :concat_basedir, '/tmp' # puppetlabs-concat +add_custom_fact :mongodb_version, '2.4.14' # puppetlabs-mongodb +add_custom_fact :root_home, '/root' # puppetlabs-stdlib +add_custom_fact :puppetversion, Puppet.version # Facter, but excluded from rspec-puppet-facts + # Workaround for no method in rspec-puppet to pass undef through :params class Undef def inspect; 'undef'; end